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

Merge pull request 'OZG-3184 check if sso url contains https' (#24) from...

Merge pull request 'OZG-3184 check if sso url contains https' (#24) from OZG-3184-fix-helmchart into master

Reviewed-on: https://git.ozg-sh.de/mgm/user-manager/pulls/24
parents bf5f51f8 048ef247
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ Das Helm Chart für das Deployment des UserManager. ...@@ -8,7 +8,7 @@ Das Helm Chart für das Deployment des UserManager.
## Unit-Tests ## Unit-Tests
Für Unit-Tests wird das helm [helm-unittest](https://github.com/quintush/helm-unittest) plugin benötigt. Die Unit-Tests liegen im Verzeichnis src/test/helm Für Unit-Tests wird das helm [helm-unittest](https://github.com/quintush/helm-unittest) plugin benötigt. Die Unit-Tests liegen im Verzeichnis src/test/helm
`helm unittest -f '../../test/helm/*.yaml' .` `helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' .`
## SyntaxCheck ## SyntaxCheck
`helm template --debug -f test-values.yaml .` `helm template --debug -f test-values.yaml .`
......
...@@ -105,8 +105,12 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -105,8 +105,12 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}} {{- end -}}
{{- define "app.ssoServerUrl" -}} {{- define "app.ssoServerUrl" -}}
{{- if contains "https://" .Values.sso.serverUrl -}}
{{- .Values.sso.serverUrl -}}
{{- else -}}
{{- printf "https://%s" .Values.sso.serverUrl -}} {{- printf "https://%s" .Values.sso.serverUrl -}}
{{- end -}} {{- end -}}
{{- end -}}
{{- define "app.kopBundesland" -}} {{- define "app.kopBundesland" -}}
{{- required "kop.bundesland must be set " (.Values.kop).bundesland }} {{- required "kop.bundesland must be set " (.Values.kop).bundesland }}
......
...@@ -68,3 +68,37 @@ tests: ...@@ -68,3 +68,37 @@ tests:
content: content:
name: KOP_KEYCLOAK_API_CLIENT name: KOP_KEYCLOAK_API_CLIENT
value: sh-helm-test-goofy value: sh-helm-test-goofy
- it: sso.serverurl with https
template: deployment.yaml
release:
namespace: sh-helm-test
set:
sso.serverUrl: https://sso.test.by.kop-cloud.de
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: QUARKUS_OIDC_AUTH_SERVER_URL
value: https://sso.test.by.kop-cloud.de/realms/sh-helm-test
- contains:
path: spec.template.spec.containers[0].env
content:
name: KEYCLOAK_URL
value: https://sso.test.by.kop-cloud.de
- it: sso.serverurl without https
template: deployment.yaml
release:
namespace: sh-helm-test
set:
sso.serverUrl: sso.test.by.kop-cloud.de
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: QUARKUS_OIDC_AUTH_SERVER_URL
value: https://sso.test.by.kop-cloud.de/realms/sh-helm-test
- contains:
path: spec.template.spec.containers[0].env
content:
name: KEYCLOAK_URL
value: https://sso.test.by.kop-cloud.de
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment