diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 54775001fee442756defcbb005b29ebc6102c263..79e17f064c77f89746fe128491b9a2f406405d9a 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -123,6 +123,10 @@ spec: - name: ozgcloud_feature_organisationsEinheiten value: {{ .Values.ozgcloud.feature.organisationsEinheiten | quote }} {{- end }} + {{- if eq ((.Values.ozgcloud).feature).organisationsEinheiten "true" }} + - name: ozgcloud_organisationseinheit_zufisucheuri + value: {{ required "ozgcloud.organisationsEinheit.zufiSearchUri must be set if feature organisationsEinheiten is activated" ((.Values.ozgcloud).organisationsEinheit).zufiSearchUri}} + {{- end }} envFrom: {{- if (.Values.database).useExternal }} - secretRef: diff --git a/src/test/helm/deployment_features_test.yaml b/src/test/helm/deployment_features_test.yaml index 9e02c58d077d05b1f50bc15e8a701a36e6c4ac6f..9d32ac541d522ee86aae58ec6da622af76b878b3 100644 --- a/src/test/helm/deployment_features_test.yaml +++ b/src/test/helm/deployment_features_test.yaml @@ -60,6 +60,8 @@ tests: postfach: "true" benutzerRollen: "true" organisationsEinheiten: "true" + organisationsEinheit: + zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy} asserts: - contains: path: spec.template.spec.containers[0].env @@ -69,7 +71,7 @@ tests: - contains: path: spec.template.spec.containers[0].env content: - name: ozgcloud_feature_benutzerRollen + name: ozgcloud_feature_benutzerRollen value: "true" - contains: path: spec.template.spec.containers[0].env @@ -98,4 +100,4 @@ tests: path: spec.template.spec.containers[0].env content: name: ozgcloud_feature_organisationsEinheiten - value: "false" \ No newline at end of file + value: "false" diff --git a/src/test/helm/deployment_zufi_test.yaml b/src/test/helm/deployment_zufi_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ea877367102fd65447b39f414f07a00430811291 --- /dev/null +++ b/src/test/helm/deployment_zufi_test.yaml @@ -0,0 +1,83 @@ +# +# Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den +# Ministerpräsidenten des Landes Schleswig-Holstein +# Staatskanzlei +# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung +# +# Lizenziert unter der EUPL, Version 1.2 oder - sobald +# diese von der Europäischen Kommission genehmigt wurden - +# Folgeversionen der EUPL ("Lizenz"); +# Sie dürfen dieses Werk ausschließlich gemäß +# dieser Lizenz nutzen. +# Eine Kopie der Lizenz finden Sie hier: +# +# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 +# +# Sofern nicht durch anwendbare Rechtsvorschriften +# gefordert oder in schriftlicher Form vereinbart, wird +# die unter der Lizenz verbreitete Software "so wie sie +# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN - +# ausdrücklich oder stillschweigend - verbreitet. +# Die sprachspezifischen Genehmigungen und Beschränkungen +# unter der Lizenz sind dem Lizenztext zu entnehmen. +# + +suite: test zufi search property +release: + name: administration + namespace: sh-helm-test +templates: + - templates/deployment.yaml +set: + ozgcloud: + bundesland: sh + bezeichner: helm + sso: + serverUrl: https://sso.company.local + imagePullSecret: image-pull-secret +tests: + - it: should not contain zufi search uri if organisationseinheit feature toggle not set + set: + ozgcloud: + feature: + organisationsEinheiten: "false" + organisationsEinheit: + zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy} + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_organisationseinheit_zufisucheuri + any: true + - it: should not contain zufi search uri if organisationseinheit feature toggle is disabled + set: + ozgcloud: + organisationsEinheit: + zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy} + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_organisationseinheit_zufisucheuri + any: true + - it: should set zufi search uri + set: + ozgcloud: + feature: + organisationsEinheiten: "true" + organisationsEinheit: + zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy} + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_organisationseinheit_zufisucheuri + value: alfa/zufi/search/endpoint?searchBy={searchBy} + - it: should fail if zufi search uri is not set + set: + ozgcloud: + feature: + organisationsEinheiten: "true" + asserts: + - failedTemplate: + errorMessage: "ozgcloud.organisationsEinheit.zufiSearchUri must be set if feature organisationsEinheiten is activated"