diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index e1125f31d5c7539544f77e78fdddbfbcfa34573b..b751300901210a527e983c3866a633f31ac9adf1 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -166,11 +166,7 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- define "app.fachstelleHost" -}} {{- if (.Values.fachstelle).enabled -}} -{{- if (.Values.fachstelle).host -}} -{{ (.Values.fachstelle).host | quote }} -{{- else -}} -{{ printf "https://fachstelle.%s" (include "app.baseUrl" .) }} -{{- end -}} +{{- required "fachstelle.host must be set" .Values.fachstelle.host | quote }} {{- end -}} {{- end -}} diff --git a/src/test/helm/deployment_fachstelle_host_test.yaml b/src/test/helm/deployment_fachstelle_host_test.yaml index 2c22d73b983e5f57cf6b909d3f5110f60aa90d84..1e7335c3b04425ec5b5582725bd7feb41b932a6f 100644 --- a/src/test/helm/deployment_fachstelle_host_test.yaml +++ b/src/test/helm/deployment_fachstelle_host_test.yaml @@ -29,26 +29,14 @@ release: templates: - templates/deployment.yaml set: + baseUrl: test.sh.ozg-cloud.de ozgcloud: environment: dev bezeichner: helm imagePullSecret: test-image-pull-secret tests: - - it: should set the fachstelle host + - it: should set fachstelle host set: - baseUrl: test.sh.ozg-cloud.de - fachstelle: - enabled: true - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_fachstelle_host - value: https://fachstelle.test.sh.ozg-cloud.de - - - it: should use fachstelle host from values - set: - baseUrl: test.sh.ozg-cloud.de fachstelle: enabled: true host: https://hamburg.mein-kreis.de @@ -58,16 +46,14 @@ tests: content: name: ozgcloud_fachstelle_host value: https://hamburg.mein-kreis.de - - it: should fail if base url is not set + - it: should fail if host url is not set set: fachstelle: enabled: true asserts: - failedTemplate: - errorMessage: "baseUrl must be set" - - it: should not fail if fachstelle is not enabled and base url is not set - set: - alfaHost: alfa.de + errorMessage: "fachstelle.host must be set" + - it: should not fail if fachstelle is not enabled and host is not set asserts: - notContains: path: spec.template.spec.containers[0].env