Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

helm double quote annotations value

I am trying to quote my annotation values. I am trying like this

annotations:
  {{- range $key, $value := .Values.ingress.annotations }}
     {{ $key }}: {{ printf "%s" $value | quote }}
  {{- end }}

and this

annotations:
  {{- range $key, $value := .Values.ingress.annotations }}
     {{ $key }}: "{{ $value }}"
  {{- end }}

this is my values.yaml

annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/force-ssl-redirect: false

but it is not working. Even if I double quote the annotation value in values.yaml helm is removing the quote. Can somebody tell me how can I get helm with double quote values in annotation?

I am using Helm version 3.

like image 692
user3847894 Avatar asked Mar 03 '23 13:03

user3847894


1 Answers

You could try this:

annotations:
  {{- range $key, $value := .Values.ingress.annotations }}
     {{ $key }}: {{ $value | quote }}
  {{- end }}
like image 112
hoque Avatar answered Mar 05 '23 19:03

hoque