我无法找到获取文件内容并对此内容运行tpl的方法
Yaml输入输入文件:
spec:
{{- (tpl ($.Files.Glob config.yaml).AsConfig $) | nindent 2 }}config.yaml的内容
key1: {{ .Values.value1 }}
key2: {{ .Values.value2 }}values.yaml文件的内容
value1: value1
value2: value2Helm模板输出:
spec:
config.yaml: |-
key1: value2
key2: value2我想要的
spec:
# config.yaml: |- should be removed
key1: value2
key2: value2发布于 2020-09-22 00:26:08
使用.Files.Get而不是Glob方法。
spec:
{{ tpl ( .Files.Get "config.yaml" ) . | indent 2 }}有关更多详细信息,请访问- Accessing Files Inside Templates
https://stackoverflow.com/questions/63995470
复制相似问题