更新时间:2023-10-25 17:39:46
最后,我能够执行以下操作:
In the end I was able to do something like this:
{{ $lines := splitList "\n" .Values.config -}}
{{- range $lines }}
{{- if not (. | trim | empty) -}}
{{- $kv := . | splitn ":" 2 -}}
{{ printf "MY_APP_%s: %s" $kv._0 ($kv._1 | trim | quote) | indent 2 }}
{{ end -}}
{{- end -}}
我很难弄清{{-
vs {{
,而helm install --debug --dry-run .
在这部分中有很大帮助.
I had a hard time getting the {{-
vs {{
right, and helm install --debug --dry-run .
help a lot in this part.
有点乱,所以我很想看看是否有人有更好的解决方案.
It's kind of messy, so I would be very interested in seeing if anyone has a better solution.