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

Merge pull request 'OZG-5958 add customVars for xta-adapter' (#135) from OZG-5958 into master

parents eb9bc752 4771fdfb
No related branches found
No related tags found
No related merge requests found
......@@ -59,3 +59,21 @@ helm.sh/chart: {{ include "app.chart" . }}
{{- define "app.serviceAccountName" -}}
{{ printf "%s" ( (.Values.serviceAccount).name | default "xta-adapter-service-account" ) }}
{{- 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" -}}
{{- $customList := list -}}
{{- range $key, $value := . -}}
{{- $customList = append $customList (dict "name" $key "value" $value) }}
{{- end -}}
{{- $customList | toYaml -}}
{{- end -}}
\ No newline at end of file
......@@ -85,6 +85,9 @@ spec:
- name: grpc_client_vorgang-manager-{{ (.Values.routing).targetVorgangManagerName }}_negotiationType
value: {{ (.Values.routing).negotiationType | default "PLAINTEXT" }}
{{- end }}
{{- with include "app.getCustomList" . }}
{{ . | indent 16 }}
{{- end }}
volumeMounts:
- name: bindings
mountPath: "/bindings/ca-certificates/type"
......
......@@ -122,7 +122,6 @@ tests:
- ipBlock:
cidr: 1.2.3.4/32
- it: test network policy disabled
set:
networkPolicy:
......
......@@ -155,3 +155,45 @@ tests:
content:
name: grpc_client_vorgang-manager-vorgang-manager_negotiationType
value: "TLS"
- it: check customList as list
set:
env.customList:
- name: my_test_environment_name
value: "A test value"
- name: test_environment
value: "B test value"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: test_environment
value: "B test value"
- it: check customList as dict
set:
env.customList:
my_test_environment_name: "A test value"
test_environment: "B test value"
asserts:
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- contains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: test_environment
value: "B test value"
- it: check customList test value is not set by default
asserts:
- notContains:
path: spec.jobTemplate.spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test 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