diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index af6ba3eade67c3db52de7f493becae39e1330649..49b22dd9ec7d6f3e7caec4866f8725039d809e09 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -99,8 +99,12 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- end -}} {{- define "app.baseDomain" -}} +{{- if (.Values.baseDomain) -}} +{{ .Values.baseDomain }} +{{- else -}} {{ printf "%s-%s.%s" (include "app.ozgcloudBezeichner" .) (include "app.name" .) (include "app.baseUrl" .) }} {{- end -}} +{{- end -}} {{- define "app.alfaAddress" -}} {{ printf "https://%s.%s" (include "app.ozgcloudBezeichner" .) (required "baseUrl must be set" .Values.baseUrl) }} diff --git a/src/test/helm/deployment-url-value-test.yaml b/src/test/helm/deployment-url-value-test.yaml index f5b2b82fd3f3e3e9a9ce459d304b3742ede6aba0..49a89498d0844bf7ff414088a9aa44f0808f228c 100644 --- a/src/test/helm/deployment-url-value-test.yaml +++ b/src/test/helm/deployment-url-value-test.yaml @@ -44,4 +44,15 @@ tests: path: spec.template.spec.containers[0].env content: name: OZGCLOUD_USER_MANAGER_URL - value: https://helm-user-manager.test.company.local \ No newline at end of file + value: https://helm-user-manager.test.company.local + + - it: set baseDomain for ozgcloud_user_manager_url + template: deployment.yaml + set: + baseDomain: helm-usm.test.company.local + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: OZGCLOUD_USER_MANAGER_URL + value: https://helm-usm.test.company.local \ No newline at end of file diff --git a/src/test/helm/ingress-nginx-tests.yaml b/src/test/helm/ingress-nginx-tests.yaml index f64e9b1746c676f6e45f690cc16bb0331eb01b2f..970ad9afff5e7a2d159835a2863de519a6c7a2e7 100644 --- a/src/test/helm/ingress-nginx-tests.yaml +++ b/src/test/helm/ingress-nginx-tests.yaml @@ -92,4 +92,20 @@ tests: asserts: - equal: path: spec.tls[0].hosts[0] - value: helm-user-manager.test.sh.ozg-cloud.de \ No newline at end of file + value: helm-user-manager.test.sh.ozg-cloud.de + + - it: should set ingress host + set: + baseDomain: helm-usm.test.company.local + asserts: + - equal: + path: spec.rules[0].host + value: helm-usm.test.company.local + + - it: should set ingress tls host + set: + baseDomain: helm-usm.test.company.local + asserts: + - equal: + path: spec.tls[0].hosts[0] + value: helm-usm.test.company.local \ No newline at end of file