I have the following code block in my Helm chart (deployment.yml)
{{`{{- with secret "my/path/kv/key" }}
{{ .Data.data.key | indent 10 }}
{{- end }} `}}
I would like to replace the second line {{ .Data.data.key | indent 10 }} with a variable from Values file.
For instance, instead of having .Data.data.key hardcoded, I would like to have a variable, which can take for instance
{{ .Data.data.key | indent 10 }}
{{ .Data.key | indent 10 }}
{{ .Data.data.mykey | indent 10 }}
etc
I went to add this to my Values file:
vault:
data_path: .Data.data.key
vault:
data_path: .Data.key
vault:
data_path: .Data.data.mykey
And this to my deployment file:
{{`{{- with secret "my/path/kv/key" }}
{{ {{ .Values.vault.data_path }} | indent 10 }}
{{- end }} `}}
I was hoping this would evaluate and take the value from the Values file.
However, it is not working.
The result would be just:
{{`{{- with secret "my/path/kv/key" }}
{{ {{ .Values.vault.data_path }} | indent 10 }}
{{- end }} `}}
Instead of
{{`{{- with secret "my/path/kv/key" }}
{{ .Data.data.key | indent 10 }}
{{- end }} `}}
What is the correct syntax to evaluate the second line?