Reputation: 93
I have this helm parameters in a values.yaml file.
spec:
containers:
- name: mycontainer
image: my.image.url
I would like to reference the name and image parameters from another kubernetes-resource.yaml file with index.
I tried
containerReference: {{ index .Values.spec.containers[0].name | quote }}
and
containerReference: {{ (index .Values.spec.containers 0).name | quote }}
But I get: bad character U+002D '-'
Upvotes: 5
Views: 11648
Reputation: 4648
try
{{ with index .Values.spec.containers 0 }}
containerReference: {{ .name | quote }}
{{ end }}
Upvotes: 12