【发布时间】:2022-05-13 17:36:30
【问题描述】:
我正在寻找一种解决方案,将我的 values.yaml 中的列表转换为逗号分隔的列表。
values.yaml
app:
logfiletoexclude:
- "/var/log/containers/kube*"
- "/var/log/containers/tiller*"
_helpers.tpl:
{{- define "pathtoexclude" -}}
{{- join "," .Values.app.logfiletoexclude }}
{{- end -}}
配置图:
<source>
@type tail
path /var/log/containers/*.log
exclude_path [{{ template "pathtoexclude" . }}]
...
...
</source>
问题是我的结果中缺少引号
exclude_path [/var/log/containers/kube*,/var/log/containers/tiller*]
我该如何解决它才能拥有:
exclude_path ["/var/log/containers/kube*","/var/log/containers/tiller*"]
我试过了:
{{- join "," .Values.app.logfiletoexclude | quote}}
但这给了我:
exclude_path ["/var/log/containers/kube*,/var/log/containers/tiller*"]
谢谢
【问题讨论】:
标签: kubernetes-helm