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

OZG-3034 OZG-6684 Do not generate alfaHost-env variable for empty value

parent ccfbabc1
Branches
Tags
No related merge requests found
...@@ -135,11 +135,7 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -135,11 +135,7 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- define "app.alfaHost" -}} {{- define "app.alfaHost" -}}
{{- if .Values.alfaHost -}} {{- if .Values.alfaHost -}}
{{ .Values.alfaHost | quote }} {{ .Values.alfaHost | quote }}
{{- else -}} {{- else if and (.Values.ozgcloud).bezeichner .Values.baseUrl -}}
{{- $bezeichner := default "" (.Values.ozgcloud).bezeichner -}} {{ print "https://" (.Values.ozgcloud).bezeichner "." .Values.baseUrl | quote }}
{{- $baseUrl := default "" .Values.baseUrl -}}
{{- if and $bezeichner $baseUrl -}}
{{ print "https://" $bezeichner "." $baseUrl | quote }}
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
...@@ -263,8 +263,11 @@ spec: ...@@ -263,8 +263,11 @@ spec:
value: "false" value: "false"
{{- end }} {{- end }}
{{- $alfaHost := (include "app.alfaHost" .) -}}
{{- if $alfaHost }}
- name: ozgcloud_alfa_host - name: ozgcloud_alfa_host
value: {{ include "app.alfaHost" . }} value: {{ include "app.alfaHost" . }}
{{- end }}
- name: ozgcloud_vorgangManager_serviceAddress - name: ozgcloud_vorgangManager_serviceAddress
value: {{ include "app.ozgcloud_vorgangmanager_address" . }} value: {{ include "app.ozgcloud_vorgangmanager_address" . }}
......
#
# Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den
# Ministerpräsidenten des Landes Schleswig-Holstein
# Staatskanzlei
# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
#
# Lizenziert unter der EUPL, Version 1.2 oder - sobald
# diese von der Europäischen Kommission genehmigt wurden -
# Folgeversionen der EUPL ("Lizenz");
# Sie dürfen dieses Werk ausschließlich gemäß
# dieser Lizenz nutzen.
# Eine Kopie der Lizenz finden Sie hier:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Sofern nicht durch anwendbare Rechtsvorschriften
# gefordert oder in schriftlicher Form vereinbart, wird
# die unter der Lizenz verbreitete Software "so wie sie
# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
# ausdrücklich oder stillschweigend - verbreitet.
# Die sprachspezifischen Genehmigungen und Beschränkungen
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
suite: deployment alfa host environment
release:
name: vorgang-manager
namespace: by-helm-test
templates:
- templates/deployment.yaml
set:
ozgcloud:
environment: dev
imagePullSecret: test-image-pull-secret
tests:
- it: check if alfa host is set
set:
baseUrl: test.company.local
ozgcloud:
bezeichner: helm
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_alfa_host
value: https://helm.test.company.local
\ No newline at end of file
...@@ -59,30 +59,27 @@ tests: ...@@ -59,30 +59,27 @@ tests:
ozgcloud: ozgcloud:
bezeichner: bezeichner:
asserts: asserts:
- contains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: ozgcloud_alfa_host name: ozgcloud_alfa_host
value:
- it: should not set alfa host if base url is not set - it: should not set alfa host if base url is not set
set: set:
baseUrl: baseUrl:
ozgcloud: ozgcloud:
bezeichner: helm bezeichner: helm
asserts: asserts:
- contains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: ozgcloud_alfa_host name: ozgcloud_alfa_host
value:
- it: should not set alfa host if both bezeichner and base url are not set - it: should not set alfa host if both bezeichner and base url are not set
set: set:
baseUrl: baseUrl:
ozgcloud: ozgcloud:
bezeichner: bezeichner:
asserts: asserts:
- contains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: ozgcloud_alfa_host name: ozgcloud_alfa_host
value:
\ 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