From e5facbba77bf6e5b7bcf469db97d0f0d8de940bd Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Fri, 24 Feb 2023 02:29:18 +0200 Subject: [PATCH] make sure key exists --- library/common/templates/lib/dependencies/_dbWait.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/common/templates/lib/dependencies/_dbWait.tpl b/library/common/templates/lib/dependencies/_dbWait.tpl index 16fb1626..bccd6256 100644 --- a/library/common/templates/lib/dependencies/_dbWait.tpl +++ b/library/common/templates/lib/dependencies/_dbWait.tpl @@ -31,7 +31,10 @@ {{- $container := include "tc.v1.common.lib.deps.wait.clickhouse" $ | fromYaml -}} {{- if $container -}} {{- range .Values.workload -}} - {{- $_ := set .podSpec.initContainers "clickhouse-wait" $container -}} + {{- if not (hasKey "initContainers" .) -}} + {{- $_ := set .podSpec "initContainers" dict -}} + {{- end -}} + {{- $_ := set .podSpec.initContainers "clickhouse-wait" $container -}} {{- end }} {{- end -}} {{- end }}