Skip to content
Snippets Groups Projects
Commit 40fbcfc4 authored by Bastian's avatar Bastian
Browse files

ozg-8071 adjust zufi search url

parent b20946e0
No related branches found
No related tags found
1 merge request!15ozg-8071 adjust zufi search url
......@@ -24,7 +24,11 @@
{{- define "app.baseDomain" -}}
{{- printf "%s-%s.%s" (.Values.ozgcloud).bezeichner (.Values.ozgcloud).adminDomainSuffix .Values.baseUrl }}
{{- printf "%s-%s.%s" (.Values.ozgcloud).bezeichner (.Values.ozgcloud).adminDomainSuffix ( include "app.getBaseUrl" . ) }}
{{- end -}}
{{- define "app.getBaseUrl" -}}
{{- required "baseUrl muss angegeben sein" .Values.baseUrl }}
{{- end -}}
{{/* Namespace */}}
......@@ -101,3 +105,19 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- define "app.serviceAccountName" -}}
{{ printf "%s" ( (.Values.serviceAccount).name | default "administration-service-account" ) }}
{{- end -}}
{{- define "app.getZufiSearchUri" -}}
{{ if ((.Values.ozgcloud).organisationEinheit).zufiSearchUri }}
{{- printf "%s" .Values.ozgcloud.organisationEinheit.zufiSearchUri }}
{{- else -}}
{{- printf "https://%s/api/organisationseinheits?searchBy={searchBy}" ( include "app.generateAlfaUrl" . ) }}
{{- end -}}
{{- end -}}
{{- define "app.generateAlfaUrl" -}}
{{ if (.Values.ozgcloud).alfaUrl }}
{{- printf "%s" .Values.ozgcloud.alfaUrl }}
{{- else -}}
{{- printf "%s.%s" ( include "app.ozgcloudBezeichner" . ) ( include "app.getBaseUrl" . ) }}
{{- end -}}
{{- end -}}
\ No newline at end of file
......@@ -129,7 +129,7 @@ spec:
{{- end }}
{{- if eq ((.Values.ozgcloud).feature).organisationsEinheiten "true" }}
- name: ozgcloud_organisationeinheit_zufisearchuri
value: {{ required "ozgcloud.organisationEinheit.zufiSearchUri must be set if feature organisationsEinheiten is activated" ((.Values.ozgcloud).organisationEinheit).zufiSearchUri}}
value: {{ include "app.getZufiSearchUri" . }}
{{- end }}
envFrom:
{{- if (.Values.database).useExternal }}
......
......@@ -23,7 +23,7 @@
#
replicaCount: 1
baseUrl: ozg-sh.de
baseUrl:
ozgcloud:
bezeichner: helm
......
......@@ -41,8 +41,6 @@ tests:
ozgcloud:
feature:
organisationsEinheiten: "false"
organisationEinheit:
zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy}
asserts:
- notContains:
path: spec.template.spec.containers[0].env
......@@ -50,34 +48,54 @@ tests:
name: ozgcloud_organisationeinheit_zufisearchuri
any: true
- it: should not contain zufi search uri if organisationseinheit feature toggle is disabled
set:
ozgcloud:
organisationEinheit:
zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy}
asserts:
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_organisationeinheit_zufisearchuri
any: true
- it: should generate zufi search uri
set:
ozgcloud:
feature:
organisationsEinheiten: "true"
baseUrl: ozg-sh.de
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_organisationeinheit_zufisearchuri
value: https://helm.ozg-sh.de/api/organisationseinheits?searchBy={searchBy}
- it: should set zufi search uri
set:
ozgcloud:
feature:
organisationsEinheiten: "true"
organisationEinheit:
zufiSearchUri: alfa/zufi/search/endpoint?searchBy={searchBy}
zufiSearchUri: "https://company.local/api/organisationseinheits?searchBy={searchBy}"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_organisationeinheit_zufisearchuri
value: "https://company.local/api/organisationseinheits?searchBy={searchBy}"
- it: should set alfa url
set:
ozgcloud:
feature:
organisationsEinheiten: "true"
alfaUrl: "alfa.local"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_organisationeinheit_zufisearchuri
value: alfa/zufi/search/endpoint?searchBy={searchBy}
- it: should fail if zufi search uri is not set
value: "https://alfa.local/api/organisationseinheits?searchBy={searchBy}"
- it: should fail without baseUrl and alfaUrl and zufiSearchUrl
set:
ozgcloud:
feature:
organisationsEinheiten: "true"
asserts:
- failedTemplate:
errorMessage: "ozgcloud.organisationEinheit.zufiSearchUri must be set if feature organisationsEinheiten is activated"
errorMessage: "baseUrl muss angegeben sein"
\ No newline at end of file
......@@ -33,6 +33,7 @@ set:
bundesland: by
bezeichner: helm
environment: test
baseUrl: ozg-sh.de
tests:
- it: should contain header data
set:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment