掌舵双引号注释值

helm double quote annotations value

我正在尝试引用我的注释值。我正在尝试这样

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

还有这个

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

这是我的values.yaml

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

但它不起作用。即使我双引号 values.yaml 中的注释值,helm 也会删除引号。有人能告诉我如何在注释中使用双引号值获得 helm 吗?

我正在使用 Helm 版本 3。

你可以试试这个:

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