Skip to content
Snippets Groups Projects
Commit 478fed7b authored by OZGCloud's avatar OZGCloud
Browse files

ozg-5100 fix dict to list

parent cc21349b
No related branches found
No related tags found
No related merge requests found
......@@ -150,8 +150,9 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- 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
......@@ -40,22 +40,35 @@ tests:
env.customList:
- name: my_test_environment_name
value: "A test value"
- name: test_environment
value: "B test value"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- contains:
path: 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.template.spec.containers[0].env
content:
name: my_test_environment_name
value: "A test value"
- contains:
path: 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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment