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

Merge pull request 'ozg-7365 add configmap for keycloak theme urls' (#869)...

Merge pull request 'ozg-7365 add configmap for keycloak theme urls' (#869) from ozg-7365-keycloak-theme-url-configmap into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/869


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 4a207719 6f4a3622
Branches
Tags
No related merge requests found
...@@ -72,4 +72,28 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -72,4 +72,28 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- define "app.getImageName" -}} {{- define "app.getImageName" -}}
{{- required "image.name muss angegeben sein" .Values.image.name }} {{- required "image.name muss angegeben sein" .Values.image.name }}
{{- end -}}
{{- define "app.getBarrierefreiheitUrl" -}}
{{- if .Values.keycloakTheme.barrierefreiheitUrl -}}
{{ .Values.keycloakTheme.barrierefreiheitUrl }}
{{- else -}}
{{ printf "https://%s/barrierefreiheit" .Values.baseDomain }}
{{- end -}}
{{- end -}}
{{- define "app.getDatenschutzUrl" -}}
{{- if .Values.keycloakTheme.datenschutzUrl -}}
{{ .Values.keycloakTheme.datenschutzUrl }}
{{- else -}}
{{ printf "https://%s/datenschutz" .Values.baseDomain }}
{{- end -}}
{{- end -}}
{{- define "app.getImpressumUrl" -}}
{{- if .Values.keycloakTheme.impressumUrl -}}
{{ .Values.keycloakTheme.impressumUrl }}
{{- else -}}
{{ printf "https://%s/impressum" .Values.baseDomain }}
{{- end -}}
{{- end -}} {{- end -}}
\ No newline at end of file
{{- if not .Values.keycloakTheme.disableUrlConfigMap -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ required "keycloakTheme.urlConfigMapName muss angegeben sein" .Values.keycloakTheme.urlConfigMapName }}
namespace: {{ required "keycloakTheme.urlConfigMapNamespace muss angegeben sein" .Values.keycloakTheme.urlConfigMapNamespace }}
data:
staticUrlBarrierefreiheit: {{ include "app.getBarrierefreiheitUrl" . }}
staticUrlDatenschutz: {{ include "app.getDatenschutzUrl" . }}
staticUrlImpressum: {{ include "app.getImpressumUrl" . }}
{{- end -}}
\ No newline at end of file
...@@ -19,4 +19,15 @@ disableMonitoring: ...@@ -19,4 +19,15 @@ disableMonitoring:
serviceAccount: serviceAccount:
create: create:
name: info-client-service-account name: info-client-service-account
\ No newline at end of file
keycloakTheme:
disableUrlConfigMap: false
urlConfigMapName:
urlConfigMapNamespace:
# default: https://<baseDomain>/barrierefreiheit
# barrierefreiheitUrl:
# default: https://<baseDomain>/datenschutz
# datenschutzUrl:
# default: https://<baseDomain>/impressum
# impressumUrl:
\ No newline at end of file
image: image:
name: info-client-test name: info-client-test
baseDomain: static.dev.by.ozg-cloud.de baseDomain: static.dev.by.ozg-cloud.de
\ No newline at end of file
keycloakTheme:
urlConfigMapName: keycloak-theme-test
urlConfigMapNamespace: keycloak-namespace
\ No newline at end of file
suite: test ConfigMap Keycloak Theme Url
release:
name: info-client
namespace: by-helm-test
templates:
- templates/configmap_keycloak_theme_url.yaml
set:
baseDomain: test.ozgcloud.de
tests:
- it: validate configMap values
set:
keycloakTheme:
urlConfigMapName: keycloak-theme-test
urlConfigMapNamespace: keycloak-namespace
asserts:
- isKind:
of: ConfigMap
- isAPIVersion:
of: v1
- equal:
path: metadata.name
value: keycloak-theme-test
- equal:
path: metadata.namespace
value: keycloak-namespace
- it: disable configMap
set:
keycloakTheme:
disableUrlConfigMap: true
asserts:
- hasDocuments:
count: 0
- it: should fail if keycloakTheme.urlConfigMapName is not set
set:
keycloakTheme:
urlConfigMapNamespace: keycloak-namespace
asserts:
- failedTemplate:
errorMessage: "keycloakTheme.urlConfigMapName muss angegeben sein"
- it: should fail if keycloakTheme.urlConfigMapNamespace is not set
set:
keycloakTheme:
urlConfigMapName: keycloak-theme-test
asserts:
- failedTemplate:
errorMessage: "keycloakTheme.urlConfigMapNamespace muss angegeben sein"
- it: validate default URLs
set:
keycloakTheme:
urlConfigMapName: keycloak-theme-test
urlConfigMapNamespace: keycloak-namespace
asserts:
- equal:
path: data.staticUrlBarrierefreiheit
value: https://test.ozgcloud.de/barrierefreiheit
- equal:
path: data.staticUrlDatenschutz
value: https://test.ozgcloud.de/datenschutz
- equal:
path: data.staticUrlImpressum
value: https://test.ozgcloud.de/impressum
- it: set barrierefreiheit url
set:
keycloakTheme:
urlConfigMapName: keycloak-theme-test
urlConfigMapNamespace: keycloak-namespace
barrierefreiheitUrl: "https://ozgcloud.de/barrierefreiheit"
asserts:
- equal:
path: data.staticUrlBarrierefreiheit
value: "https://ozgcloud.de/barrierefreiheit"
- it: set datenschutz url
set:
keycloakTheme:
urlConfigMapName: keycloak-theme-test
urlConfigMapNamespace: keycloak-namespace
datenschutzUrl: https://ozgcloud.de/datenschutz
asserts:
- equal:
path: data.staticUrlDatenschutz
value: https://ozgcloud.de/datenschutz
- it: set impressum url
set:
keycloakTheme:
urlConfigMapName: keycloak-theme-test
urlConfigMapNamespace: keycloak-namespace
impressumUrl: https://ozgcloud.de/impressum
asserts:
- equal:
path: data.staticUrlImpressum
value: https://ozgcloud.de/impressum
\ 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