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

OZG-6177 set ETR_NAMESPACE from env

parent aeb1e5f9
No related branches found
No related tags found
No related merge requests found
...@@ -50,11 +50,12 @@ spec: ...@@ -50,11 +50,12 @@ spec:
- name: ozgcloud-elster-transfer-operator - name: ozgcloud-elster-transfer-operator
image: "{{ (.Values.image).repo }}/{{ (.Values.image).name }}:{{ coalesce (.Values.image).tag "latest" }}" image: "{{ (.Values.image).repo }}/{{ (.Values.image).name }}:{{ coalesce (.Values.image).tag "latest" }}"
env: env:
- name: ETR_NAMESPACE
value: "{{ .Values.etrNamespace | default "elster-transfer" }}"
{{- with include "app.getCustomList" . }} {{- with include "app.getCustomList" . }}
{{ . | indent 8 }} {{ . | indent 8 }}
{{- end }} {{- end }}
imagePullPolicy: Always imagePullPolicy: Always
resources: resources:
{{- with .Values.resources }} {{- with .Values.resources }}
{{ toYaml . | indent 10 }} {{ toYaml . | indent 10 }}
......
...@@ -23,14 +23,17 @@ ...@@ -23,14 +23,17 @@
*/ */
package de.ozgcloud.operator.elstertransfer.user; package de.ozgcloud.operator.elstertransfer.user;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
public class Constants { public class Constants {
public static final String CONFIG_MAP_NAME = "etr-user-config"; public static final String CONFIG_MAP_NAME = "etr-user-config";
public static final String USERS_KEY = "users.yaml"; public static final String USERS_KEY = "users.yaml";
public static final String ELSTER_TRANSFER_USER_LOGIN_KEY = "login"; public static final String ELSTER_TRANSFER_USER_LOGIN_KEY = "login";
public static final String ELSTER_TRANSFER_USER_PASSWORD_KEY = "password"; public static final String ELSTER_TRANSFER_USER_PASSWORD_KEY = "password";
// todo @Value("${etr.namespace}")
public static final String ETR_NAMESPACE = "etr-user-creation"; public static String ETR_NAMESPACE;
public static final String USER_ROLE = "USER"; public static final String USER_ROLE = "USER";
public static final String ETR_DEPLOYMENT_NAME = "elster-transfer"; public static final String ETR_DEPLOYMENT_NAME = "elster-transfer";
public static final String MUK_USER_SECRET_NAME = "muk-user-secret"; public static final String MUK_USER_SECRET_NAME = "muk-user-secret";
......
...@@ -21,3 +21,8 @@ management: ...@@ -21,3 +21,8 @@ management:
web: web:
exposure: exposure:
include: "*" include: "*"
etr:
namespace: elster-transfer
\ No newline at end of file
...@@ -69,3 +69,20 @@ tests: ...@@ -69,3 +69,20 @@ tests:
name: test_environment name: test_environment
value: "B test value" value: "B test value"
- it: should contain env ETR_NAMESPACE with default value
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ETR_NAMESPACE
value: "elster-transfer"
- it: should set env ETR_NAMESPACE
set:
etrNamespace: "elster-transfer2"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ETR_NAMESPACE
value: "elster-transfer2"
\ 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