Skip to content
Snippets Groups Projects
Commit 84c6d958 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4800-refactor baseUrl, baseDomain and add helm unnittests

parent 174bdcbf
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,11 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}}
{{- define "app.baseUrl" -}}
{{ printf "https://%s-%s.%s" (include "app.ozgcloudBezeichner" .) (include "app.name" .) .Values.baseUrl }}
{{- required "baseUrl muss angegeben sein" .Values.baseUrl }}
{{- end -}}
{{- define "app.baseDomain" -}}
{{ printf "%s-%s.%s" (include "app.ozgcloudBezeichner" .) (include "app.name" .) (include "app.baseUrl" .) }}
{{- end -}}
{{- define "app.alfaAddress" -}}
......
......@@ -100,7 +100,7 @@ spec:
- name: KEYCLOAK_URL
value: {{ include "app.ssoServerUrl" . }}
- name: OZGCLOUD_USER_MANAGER_URL
value: {{ include "app.baseUrl" . }}
value: https://{{ include "app.baseDomain" . }}
{{- if ((.Values.ozgcloud).usersync).period }}
- name: OZGCLOUD_USERSYNC_PERIOD
value: {{ .Values.ozgcloud.usersync.period }}
......
......@@ -54,10 +54,10 @@ spec:
name: {{ include "app.name" . }}
path: ''
pathType: ImplementationSpecific
host: {{ trimPrefix "https://" ( include "app.baseUrl" . ) }}
host: {{ ( include "app.baseDomain" . ) }}
tls:
- hosts:
- {{ trimPrefix "https://" ( include "app.baseUrl" . ) }}
- {{ ( include "app.baseDomain" . ) }}
{{- if (.Values.ingress).tlsSecretName }}
secretName: {{ (.Values.ingress).tlsSecretName }}
{{- else if ne (.Values).cluster_env "dataport" }}
......
......@@ -76,3 +76,15 @@ tests:
- equal:
path: metadata.annotations["cert-manager.io/cluster-issuer"]
value: letsencrypt-prod
- it: should create hostname correctly
asserts:
- equal:
path: spec.rules[0].host
value: helm-user-manager.test.sh.ozg-cloud.de
- it: should create tls hosts name correctly
asserts:
- equal:
path: spec.tls[0].hosts[0]
value: helm-user-manager.test.sh.ozg-cloud.de
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment