From 2c7be270d18cc05c8f1b14cb69a77cd19d1d68d1 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Sun, 28 May 2023 14:17:51 +0200 Subject: [PATCH] fix(common): don't try to lookup a configmap in a potentially non-existing namespace --- library/common/templates/lib/util/_register_operator.tpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/common/templates/lib/util/_register_operator.tpl b/library/common/templates/lib/util/_register_operator.tpl index c6e7f295..a5af0433 100644 --- a/library/common/templates/lib/util/_register_operator.tpl +++ b/library/common/templates/lib/util/_register_operator.tpl @@ -1,7 +1,9 @@ {{- define "tc.v1.common.lib.util.operator.register" -}} {{- if .Values.operator.register -}} - {{- with (lookup "v1" "ConfigMap" "tc-system" $.Chart.Name) -}} - {{- fail (printf "You cannot install the [%s] operator twice..." $.Chart.Name) -}} + {{- with (lookup "v1" "Namespace" "tc-system" "") -}} + {{- with (lookup "v1" "ConfigMap" "tc-system" $.Chart.Name) -}} + {{- fail (printf "You cannot install the [%s] operator twice..." $.Chart.Name) -}} + {{- end -}} {{- end -}} {{- $objectData := (dict "name" $.Chart.Name