From 50fbd98f2792b9e2043f36ef5abc0bb1ef09890a Mon Sep 17 00:00:00 2001 From: cmontemuino <1761056+cmontemuino@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:10:10 +0100 Subject: [PATCH] fix(kube-state-metrics): skip imagePullSecrets when no override provided Template for ServiceAccount is not taking into account that element `serviceAccount.imagePullSecrets` might be empty. In such a case, an empty element `imagePullSecrets` is added to the ServiceAccount resource. fixes #4059 Signed-off-by: cmontemuino <1761056+cmontemuino@users.noreply.github.com> --- charts/kube-state-metrics/templates/serviceaccount.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/kube-state-metrics/templates/serviceaccount.yaml b/charts/kube-state-metrics/templates/serviceaccount.yaml index a7ff4dd3d7e3..76d00a35aa1f 100644 --- a/charts/kube-state-metrics/templates/serviceaccount.yaml +++ b/charts/kube-state-metrics/templates/serviceaccount.yaml @@ -10,6 +10,8 @@ metadata: annotations: {{ toYaml .Values.serviceAccount.annotations | indent 4 }} {{- end }} +{{- if .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: {{- include "kube-state-metrics.imagePullSecrets" (dict "Values" .Values "imagePullSecrets" .Values.serviceAccount.imagePullSecrets) | indent 2 }} +{{- end }} {{- end -}}