im trying to a loop with a range in helm but using 2 variables, what i have..
values.yaml
master:
slave1:
- slave1value1
- slave1value2
slave2:
- slave2value1
- slave2value2
My actual loop.
{{- range .Values.master.slave1 }}
name: http://slave1-{{ . }}
{{- end }}
{{- range .Values.master.slave2 }}
name: http://slave2-{{ . }}
{{- end }}
This is actually doing what i need, the output will be like this...
looping on .Values.master.slave1
name: http://slave1-slave1value1
name: http://slave1-slave1value2
looping on .Values.master.slave2
name: http://slave2-slave1value1
name: http://slave2-slave1value2
This is fully working for now, the question is, can i achieve the same result using just one loop block ? i tried this.
{{ alias := .Values.master }}
{{- range $alias }}
name: http://{{ . }}-{{ $alias.name }}
{{- end }}
But the output is not what I'm expecting, thanks in advance.
too many declarations in command
– Material