From 6433ef03b15361da44bfd5bac2927dae4c745885 Mon Sep 17 00:00:00 2001 From: Ruslan Aliev Date: Mon, 28 Apr 2025 15:34:19 -0500 Subject: [PATCH] Add default dict for pod anti affinity snippet In case if anti affinity type is empty or doesn't match with expected values return an empty dict to maintain valid yaml structure. Change-Id: Id056a028a4ba56a6a1ebc244524e77b19106371e Signed-off-by: Ruslan Aliev --- .../templates/snippets/_kubernetes_pod_anti_affinity.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helm-toolkit/templates/snippets/_kubernetes_pod_anti_affinity.tpl b/helm-toolkit/templates/snippets/_kubernetes_pod_anti_affinity.tpl index fabbcf8d99..f9fe9f95e1 100644 --- a/helm-toolkit/templates/snippets/_kubernetes_pod_anti_affinity.tpl +++ b/helm-toolkit/templates/snippets/_kubernetes_pod_anti_affinity.tpl @@ -85,5 +85,7 @@ podAntiAffinity: matchExpressions: {{ $matchExpressions | indent 8 }} topologyKey: {{ $antiAffinityKey }} +{{- else }} + {} {{- end -}} {{- end -}}