From 19f9c3cb21a48070866e0f300da326fcfba2873e Mon Sep 17 00:00:00 2001 From: Philipp Hossner Date: Fri, 20 Dec 2024 14:33:27 +0000 Subject: [PATCH] MAJOR: kubernetes-ingress: Make controller.podAnnotations templatable Signed-off-by: Philipp Hossner --- .../ci/deployment-podannotations-templated-values.yaml | 5 +++++ kubernetes-ingress/templates/controller-deployment.yaml | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 kubernetes-ingress/ci/deployment-podannotations-templated-values.yaml diff --git a/kubernetes-ingress/ci/deployment-podannotations-templated-values.yaml b/kubernetes-ingress/ci/deployment-podannotations-templated-values.yaml new file mode 100644 index 0000000..9f76a57 --- /dev/null +++ b/kubernetes-ingress/ci/deployment-podannotations-templated-values.yaml @@ -0,0 +1,5 @@ +controller: + podAnnotations: | + my-checksum: {{ $.Values.myCustomVar | toYaml | sha256sum }} +myCustomVar: + FOO: BAR diff --git a/kubernetes-ingress/templates/controller-deployment.yaml b/kubernetes-ingress/templates/controller-deployment.yaml index d8c662e..5e14177 100644 --- a/kubernetes-ingress/templates/controller-deployment.yaml +++ b/kubernetes-ingress/templates/controller-deployment.yaml @@ -52,7 +52,11 @@ spec: {{- end }} {{- if .Values.controller.podAnnotations }} annotations: +{{- if eq "string" (printf "%T" .Values.controller.podAnnotations) }} +{{ tpl .Values.controller.podAnnotations . | indent 8 }} +{{- else }} {{ toYaml .Values.controller.podAnnotations | indent 8 }} +{{- end }} {{- end }} spec: enableServiceLinks: {{ .Values.controller.enableServiceLinks }}