diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index f102cd897f8ff2d7604545505fefb2e048629ff6..c48966281f3d8741fc2a63d815c86965858efb20 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -39,6 +39,7 @@ component: antragraum-proxy {{- required "baseUrl muss angegeben sein" .Values.baseUrl }} {{- end -}} + {{- define "app.getCustomList" -}} {{- with (.Values.env).customList -}} {{- if kindIs "map" . -}} diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index f01228e0fa123a71f177334b60de7fe06c20a953..876433b80f092d42945555f090151edc469fc7b8 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -58,8 +58,10 @@ spec: app.kubernetes.io/name: {{ .Release.Name }} containers: - env: - - name: APP_ENV - value: "{{ .Values.appEnv | default "" }}" + {{- if (.Values.env).overrideGoProfiles }} + - name: ACTIVE_PROFILE + value: {{ (.Values.env).overrideGoProfiles }} + {{- end }} {{- with include "app.getCustomList" . }} {{ . | indent 10 }} {{- end }} diff --git a/src/test/helm/deployment_env_test.yaml b/src/test/helm/deployment_env_test.yaml index f02566e743597d354652d865062100f815ffca30..3ccbb91c40d2cb69c257ce616c6453ee3a160831 100644 --- a/src/test/helm/deployment_env_test.yaml +++ b/src/test/helm/deployment_env_test.yaml @@ -63,19 +63,18 @@ tests: name: test_environment value: "B test value" - - it: check envs default values + - it: should have env ACTIVE_PROFILE with correct value when set + set: + env.overrideGoProfiles: oc,test,ea asserts: - contains: path: spec.template.spec.containers[0].env content: - name: APP_ENV - value: "" - - it: should set APP_ENV - set: - appEnv: prod + name: ACTIVE_PROFILE + value: oc,test,ea + + - it: should by default not have the ACTIVE_PROFILE env asserts: - - contains: + - equal: path: spec.template.spec.containers[0].env - content: - name: APP_ENV - value: "prod" \ No newline at end of file + value: null \ No newline at end of file