Skip to content
Snippets Groups Projects
Commit 4771fdfb authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5958 update xta dictToList function and unittests

parent 8ab30828
Branches
Tags
No related merge requests found
......@@ -71,8 +71,9 @@ helm.sh/chart: {{ include "app.chart" . }}
{{- end -}}
{{- define "app.dictToList" -}}
{{- $customList := list -}}
{{- range $key, $value := . -}}
- name: {{ $key }}
value: {{ $value }}
{{- $customList = append $customList (dict "name" $key "value" $value) }}
{{- end -}}
{{- $customList | toYaml -}}
{{- end -}}
\ No newline at end of file
......@@ -160,22 +160,35 @@ tests:
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment