diff --git a/library/common-test/values.yaml b/library/common-test/values.yaml index 3d760be3..33be6a5c 100644 --- a/library/common-test/values.yaml +++ b/library/common-test/values.yaml @@ -19,6 +19,9 @@ service: ports: main: enabled: false +operator: + verify: + failOnError: true manifestManager: enabled: false diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 96a702e0..06ddb13d 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 12.10.8 +version: 12.10.9 diff --git a/library/common/templates/lib/util/_verify_operator.tpl b/library/common/templates/lib/util/_verify_operator.tpl index 79fc0540..c395ce68 100644 --- a/library/common/templates/lib/util/_verify_operator.tpl +++ b/library/common/templates/lib/util/_verify_operator.tpl @@ -5,7 +5,7 @@ {{- $opExists := include "tc.v1.common.lib.util.operator.verify" (dict "rootCtx" $ "opName" $opName) -}} {{/* If the operator was not found */}} - {{- if eq $opExists "false" -}} + {{- if and (eq $opExists "false") ($.Values.operator.verify.failOnError) -}} {{- fail (printf "Operator [%s] have to be installed first" $opName) -}} {{- end -}} {{- end -}} @@ -22,11 +22,17 @@ {{- if $cm.data -}} {{/* If "tc-operator-name" does not exist will return "" */}} {{- $name := (get $cm.data "tc-operator-name") -}} + {{- $version := (get $cm.data "tc-operator-version") -}} {{/* If fetched name matches the "$opName"... */}} {{- if eq $name $opName -}} + {{- if $opExists -}} + {{- fail (printf "Found duplicate configmaps for operator [%s]" $opName) -}} + {{- end -}} {{/* Mark operator as found*/}} {{- $opExists = true -}} + {{- $operatorData := dict "name" $name "namespace" $cm.metadata.namespace "version" $version -}} + {{- $_ := set $.Values.operator $opName $operatorData -}} {{- end -}} {{- end -}} {{- end -}} diff --git a/library/common/values.yaml b/library/common/values.yaml index a5fbd95a..f2ddb17e 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -564,6 +564,7 @@ operator: # -- Verified wether required operators for this chart are actually installed and registered verify: enabled: true + failOnError: false # -- a list of extra operators to check for additionalOperators: []