How to update attribute in array with helm? How to update attribute in array with helm? kubernetes kubernetes

How to update attribute in array with helm?


It's not entirely clear to me what you want to achieve. I assume your goal is to construct the url field from the name field (although in the provided example you are altering the name instead of the url (?)). You can do it by updating the hostData before converting it to JSON:

test:   {{- with .Values.env }}  {{- range .hostData}}    {{- $url := print "https://" .name "/newName" }}    {{- $_ := set . "url" $url }}  {{- end }}     hostData: {{ .hostData | toJson }}  isTest: {{ .isTest }}    {{- end }}