diff --git a/elster-transfer/templates/deployment.yaml b/elster-transfer/templates/deployment.yaml index 5bb04063b5a784c2d9caea016b1c835a48ac1bbe..9ebaaa997d5e0a1bfb73cd893a5cc2def44fa70e 100644 --- a/elster-transfer/templates/deployment.yaml +++ b/elster-transfer/templates/deployment.yaml @@ -33,6 +33,14 @@ spec: containers: - image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" env: + {{- if (.Values.userAuthentication).enabled }} + - name: ETR_SICHERHEIT_AUTHENTIFIZIERUNG + value: "yaml" + - name: ETR_SICHERHEIT_YAML_CREDENTIALS-FILE-PATH + value: /home/etr/etr-user/users.yaml + - name: ETR_GRUPPENMODUS + value: "gruppen_token" + {{- end }} {{- with include "app.getCustomList" . }} {{ . | indent 8 }} {{- end }} @@ -68,11 +76,19 @@ spec: volumeMounts: - name: etr-home mountPath: "/home/etr" + {{- if (.Values.userAuthentication).enabled }} + - name: etr-user + mountPath: "/home/etr/etr-user" + {{- end }} volumes: - name: etr-home persistentVolumeClaim: claimName: {{ .Release.Name }}-home-pvc - + {{- if (.Values.userAuthentication).enabled }} + - name: etr-user + configMap: + name: etr-user-config + {{- end }} imagePullSecrets: - name: {{ required "imagePullSecret must be set" .Values.imagePullSecret }} restartPolicy: Always diff --git a/elster-transfer/unit-tests/deployment_env_test.yaml b/elster-transfer/unit-tests/deployment_env_test.yaml index 37a67d1c0e2b38c6e305c4adccd0a71356079352..7b0a5e67ab73e4ea97a679d41af8187636476615 100644 --- a/elster-transfer/unit-tests/deployment_env_test.yaml +++ b/elster-transfer/unit-tests/deployment_env_test.yaml @@ -46,3 +46,24 @@ tests: asserts: - isNullOrEmpty: path: spec.template.spec.containers[0].env + + - it: should add etr sicherheit Envs + set: + userAuthentication: + enabled: true + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ETR_SICHERHEIT_AUTHENTIFIZIERUNG + value: "yaml" + - contains: + path: spec.template.spec.containers[0].env + content: + name: ETR_SICHERHEIT_YAML_CREDENTIALS-FILE-PATH + value: /home/etr/etr-user/users.yaml + - contains: + path: spec.template.spec.containers[0].env + content: + name: ETR_GRUPPENMODUS + value: "gruppen_token" \ No newline at end of file diff --git a/elster-transfer/unit-tests/deployment_volume_mount_test.yaml b/elster-transfer/unit-tests/deployment_volume_mount_test.yaml index 82805822b7cc51520716ec8e10b63b0a791d5b09..093e4f6471640bffb280f4ad0b73b6ae2b9779e2 100644 --- a/elster-transfer/unit-tests/deployment_volume_mount_test.yaml +++ b/elster-transfer/unit-tests/deployment_volume_mount_test.yaml @@ -21,4 +21,42 @@ tests: content: name: etr-home persistentVolumeClaim: - claimName: etr-home-pvc \ No newline at end of file + claimName: etr-home-pvc + + - it: should add etr-user volume mount + set: + userAuthentication: + enabled: true + asserts: + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: etr-user + mountPath: "/home/etr/etr-user" + - it: should add etr-user volume + set: + userAuthentication: + enabled: true + asserts: + - contains: + path: spec.template.spec.volumes + content: + name: etr-user + configMap: + name: etr-user-config + + - it: should not add etr-user volume mount + asserts: + - notContains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: etr-user + mountPath: "/home/etr/etr-user" + - it: should not add etr-user volume + asserts: + - notContains: + path: spec.template.spec.volumes + content: + name: etr-user + configMap: + name: etr-user-config \ No newline at end of file