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

ozg-5100 customList as list or dict

parent 75654226
No related branches found
No related tags found
No related merge requests found
...@@ -138,3 +138,20 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -138,3 +138,20 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- define "app.serviceAccountName" -}} {{- define "app.serviceAccountName" -}}
{{ printf "%s" ( (.Values.serviceAccount).name | default "user-manager-service-account" ) }} {{ printf "%s" ( (.Values.serviceAccount).name | default "user-manager-service-account" ) }}
{{- end -}} {{- end -}}
{{- define "app.getCustomList" -}}
{{- with (.Values.env).customList -}}
{{- if kindIs "map" . -}}
{{ include "app.dictToList" . }}
{{- else if kindIs "slice" . -}}
{{ . | toYaml }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "app.dictToList" -}}
{{- range $key, $value := . -}}
- name: {{ $key }}
value: {{ $value }}
{{- end -}}
{{- end -}}
\ No newline at end of file
...@@ -113,8 +113,8 @@ spec: ...@@ -113,8 +113,8 @@ spec:
- name: QUARKUS_GRPC_SERVER_SSL_KEY - name: QUARKUS_GRPC_SERVER_SSL_KEY
value: "" value: ""
{{- end }} {{- end }}
{{- with (.Values.env).customList }} {{- with include "app.getCustomList" . }}
{{ toYaml . | indent 8 }} {{ . | indent 8 }}
{{- end }} {{- end }}
{{- if .Values.optionalTrustStoreSecretName }} {{- if .Values.optionalTrustStoreSecretName }}
- name: TRUST_STORE_PASSWORD - name: TRUST_STORE_PASSWORD
......
...@@ -35,7 +35,7 @@ set: ...@@ -35,7 +35,7 @@ set:
baseUrl: test.sh.ozg-cloud.de baseUrl: test.sh.ozg-cloud.de
imagePullSecret: image-pull-secret imagePullSecret: image-pull-secret
tests: tests:
- it: check customList - it: check customList as list
set: set:
env.customList: env.customList:
- name: my_test_environment_name - name: my_test_environment_name
...@@ -46,6 +46,16 @@ tests: ...@@ -46,6 +46,16 @@ tests:
content: content:
name: my_test_environment_name name: my_test_environment_name
value: "A test value" value: "A test value"
- it: check customList as dict
set:
env.customList:
my_test_environment_name: "A test value"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- it: check customList test value is not set by default - it: check customList test value is not set by default
asserts: asserts:
- notContains: - notContains:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment