From 0b95c6b67b3893c655be511c91ebf16e60271f81 Mon Sep 17 00:00:00 2001 From: Philipp Hossner Date: Fri, 20 Dec 2024 15:06:07 +0000 Subject: [PATCH] BUG: : kubernetes-ingress: Fix controller.podAnnotations not being tempaltable in every location Signed-off-by: Philipp Hossner --- kubernetes-ingress/templates/controller-crdjob.yaml | 6 +++++- kubernetes-ingress/templates/controller-daemonset.yaml | 4 ++++ .../templates/controller-proxy-deployment.yaml | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/kubernetes-ingress/templates/controller-crdjob.yaml b/kubernetes-ingress/templates/controller-crdjob.yaml index 4111b79..dd7a0c5 100644 --- a/kubernetes-ingress/templates/controller-crdjob.yaml +++ b/kubernetes-ingress/templates/controller-crdjob.yaml @@ -48,7 +48,11 @@ spec: {{- $podAnnotations = merge $podAnnotations .Values.crdjob.podAnnotations }} {{- end }} {{- if .Values.controller.podAnnotations }} - {{- $podAnnotations = merge $podAnnotations .Values.controller.podAnnotations }} + {{- if eq "string" (printf "%T" .Values.controller.podAnnotations) }} + {{- $podAnnotations = merge $podAnnotations (tpl .Values.controller.podAnnotations . | fromYaml) }} + {{- else }} + {{- $podAnnotations = merge $podAnnotations .Values.controller.podAnnotations }} + {{- end }} {{- end }} {{- if not (empty $podAnnotations) }} annotations: diff --git a/kubernetes-ingress/templates/controller-daemonset.yaml b/kubernetes-ingress/templates/controller-daemonset.yaml index 50f31e4..878dc10 100644 --- a/kubernetes-ingress/templates/controller-daemonset.yaml +++ b/kubernetes-ingress/templates/controller-daemonset.yaml @@ -53,7 +53,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 }} diff --git a/kubernetes-ingress/templates/controller-proxy-deployment.yaml b/kubernetes-ingress/templates/controller-proxy-deployment.yaml index 402dbfd..2b49753 100644 --- a/kubernetes-ingress/templates/controller-proxy-deployment.yaml +++ b/kubernetes-ingress/templates/controller-proxy-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 }}