I have an helm chart with array of objects in my values.yaml
.
Each objects has:
Name,path,token.
So the array looks like:
my_array:
- name: hi
path: /some_path
token: some_token
I want to iterate over that array as follows (creating a secret):
{{ - range .Values.my_array }}
{{ .name }}-data: {{ $.Files.Get .path }}
{{ .name }}-token: {{ .token }}
{{ end }}
Inside each {{ .name }}-data
I want the actual content of the file in that path.
Doing it as above I get:
Unknown object "nil"
Everything else works fine, if I change the file path to the actual path instead of .path
it works OK.
What’s the correct syntax?