diff --git a/library/common-test/default-values.yaml b/library/common-test/default-values.yaml index 8216b707..1083365f 100644 --- a/library/common-test/default-values.yaml +++ b/library/common-test/default-values.yaml @@ -1,6 +1,3 @@ -global: - createTCNamespace: true - workload: main: enabled: true diff --git a/library/common-test/tests/defaults/defaults-test.yaml b/library/common-test/tests/defaults/defaults-test.yaml index 1fffd88b..18dab5fb 100644 --- a/library/common-test/tests/defaults/defaults-test.yaml +++ b/library/common-test/tests/defaults/defaults-test.yaml @@ -4,8 +4,6 @@ templates: tests: - it: should pass with defaults set: - global: - createTCNamespace: true service: main: enabled: true @@ -22,21 +20,11 @@ tests: enabled: true asserts: - hasDocuments: - count: 3 - - documentIndex: &namespaceDoc 0 - isKind: - of: Namespace - - documentIndex: *namespaceDoc - equal: - path: metadata.name - value: tc-system - - documentIndex: *namespaceDoc - isAPIVersion: - of: v1 - - documentIndex: &deploymentDoc 1 + count: 2 + - documentIndex: &deploymentDoc 0 isKind: of: Deployment - - documentIndex: &serviceDoc 2 + - documentIndex: &serviceDoc 1 isKind: of: Service - documentIndex: *serviceDoc diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index b668c90e..96a702e0 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.7 +version: 12.10.8 diff --git a/library/common/templates/lib/util/_tc_namespace.tpl b/library/common/templates/lib/util/_tc_namespace.tpl deleted file mode 100644 index 4bdd8dee..00000000 --- a/library/common/templates/lib/util/_tc_namespace.tpl +++ /dev/null @@ -1,17 +0,0 @@ -{{- define "tc.v1.common.lib.util.tcnamespace" -}} - {{- if $.Values.global.createTCNamespace -}} - {{/* Only create it if it does not exist */}} - {{- if not (lookup "v1" "Namespace" "" "tc-system") }} ---- -apiVersion: v1 -kind: Namespace -metadata: - name: tc-system - annotations: - "helm.sh/resource-policy": keep - "helm.sh/hook": pre-install - "helm.sh/hook-weight": "-20" - "helm.sh/hook-delete-policy": hook-failed - {{- end -}} - {{- end -}} -{{- end -}} diff --git a/library/common/templates/lib/util/_verify_operator.tpl b/library/common/templates/lib/util/_verify_operator.tpl index 94177dd9..79fc0540 100644 --- a/library/common/templates/lib/util/_verify_operator.tpl +++ b/library/common/templates/lib/util/_verify_operator.tpl @@ -19,13 +19,15 @@ {{/* Go over all configmaps */}} {{- range $index, $cm := (lookup "v1" "ConfigMap" "" "").items -}} - {{/* If "tc-operator-name" does not exist will return "" */}} - {{- $name := (get $cm.data "tc-operator-name") -}} + {{- if $cm.data -}} + {{/* If "tc-operator-name" does not exist will return "" */}} + {{- $name := (get $cm.data "tc-operator-name") -}} - {{/* If fetched name matches the "$opName"... */}} - {{- if eq $name $opName -}} - {{/* Mark operator as found*/}} - {{- $opExists = true -}} + {{/* If fetched name matches the "$opName"... */}} + {{- if eq $name $opName -}} + {{/* Mark operator as found*/}} + {{- $opExists = true -}} + {{- end -}} {{- end -}} {{- end -}} diff --git a/library/common/templates/loader/_init.tpl b/library/common/templates/loader/_init.tpl index 7e881675..9077208e 100644 --- a/library/common/templates/loader/_init.tpl +++ b/library/common/templates/loader/_init.tpl @@ -4,9 +4,6 @@ {{/* Merge chart values and the common chart defaults */}} {{- include "tc.v1.common.values.init" . -}} - {{/* Create tc-system namespace */}} - {{- include "tc.v1.common.lib.util.tcnamespace" . -}} - {{/* Parse lists and append to values */}} {{- include "tc.v1.common.loader.lists" . -}} diff --git a/library/common/values.yaml b/library/common/values.yaml index 4be3a0fc..a5fbd95a 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -13,8 +13,6 @@ global: # -- Enable to stop most pods and containers including cnpg # does not include stand-alone pods stopAll: false - # -- Creates the tc-system namespace. Used for operator charts - createTCNamespace: true fallbackDefaults: # -- Define a storageClassName that will be used for all PVCs