diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index 91bca425a065c5c3520d636515a2e2babd07892c..9d582b1dbfbde913afe112ff89f76ed46bd8b7f0 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -15,6 +15,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/name: {{ .Release.Name }} app.kubernetes.io/namespace: {{ include "app.namespace" . }} helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version }} +ozgcloud-mongodb-client: "true" {{- end -}} {{- define "app.matchLabels" }} diff --git a/src/test/helm/deployment_defaults_labels_test.yaml b/src/test/helm/deployment_defaults_labels_test.yaml index c3902cfc31ebc5a5b6d6defb1b0d00fb81109e92..37a4181ad5b71049c13d5482005b4cb17a25fced 100644 --- a/src/test/helm/deployment_defaults_labels_test.yaml +++ b/src/test/helm/deployment_defaults_labels_test.yaml @@ -46,6 +46,8 @@ tests: app.kubernetes.io/name: administration app.kubernetes.io/namespace: sh-helm-test helm.sh/chart: administration-0.0.0-MANAGED-BY-JENKINS + ozgcloud-mongodb-client: "true" + - it: should set spec.selector.matchLabels asserts: - equal: @@ -65,4 +67,5 @@ tests: app.kubernetes.io/name: administration app.kubernetes.io/namespace: sh-helm-test component: administration - helm.sh/chart: administration-0.0.0-MANAGED-BY-JENKINS \ No newline at end of file + helm.sh/chart: administration-0.0.0-MANAGED-BY-JENKINS + ozgcloud-mongodb-client: "true" \ No newline at end of file diff --git a/src/test/helm/deployment_test.yaml b/src/test/helm/deployment_test.yaml index 38931a0d5485af39aced9954e331e65dc17db869..2149aac7929d554bdf6edab4a85907bc092a82de 100644 --- a/src/test/helm/deployment_test.yaml +++ b/src/test/helm/deployment_test.yaml @@ -80,6 +80,15 @@ tests: value: "RollingUpdate" - it: should have correct template configuration asserts: + - equal: + path: spec.template.metadata.labels["app.kubernetes.io/instance"] + value: "administration" + - equal: + path: spec.template.metadata.labels.component + value: "administration" + - equal: + path: metadata.labels["ozgcloud-mongodb-client"] + value: "true" - equal: path: spec.template.spec.topologySpreadConstraints[0].maxSkew value: 1 diff --git a/src/test/helm/service_test.yaml b/src/test/helm/service_test.yaml index c4c6ef1568f96617828dd144a523299e1269a4d2..eb031a886881e5e51d8781c5614fa36299dd83c0 100644 --- a/src/test/helm/service_test.yaml +++ b/src/test/helm/service_test.yaml @@ -82,4 +82,5 @@ tests: app.kubernetes.io/name: administration app.kubernetes.io/namespace: helm-test component: administration-service - helm.sh/chart: administration-0.0.0-helm-test-version \ No newline at end of file + helm.sh/chart: administration-0.0.0-helm-test-version + ozgcloud-mongodb-client: "true" \ No newline at end of file