I have several yaml files which I try to generalize.
I have util.tpl
:
{{- define "pod-test" -}}
{{- if eq .Values.appName.properties.name "m1" }}
x: {{.Values.appName.properties.x }}
{{- end }}
I would like to make the appName
string in the Values.appName.properties.x
dynamic.
I call this template from the destination YAML
{{- include "pod-test" . (list "app-name") | indent 2}}
but I can't find a way to concat to something like :
{{- $arg1 := index . 0 }}
{{.Values.{{ $arg1 }}.properties.x }}
This just doesn't work what is the best way to do it?