File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11apiVersion : v1
22name : pgdog
3- version : v0.53
3+ version : v0.54
44appVersion : " 0.1.37"
Original file line number Diff line number Diff line change 44name = {{ .name | quote }}
55database = {{ .database | quote }}
66{{- if .passwords }}
7- passwords = {{ .passwords | toToml }}
7+ passwords = [ {{ range $i, $p := .passwords }}{{ if $i }}, {{ end }}{{ $p | quote }}{{ end }}]
88{{- else if .password }}
99password = {{ .password | quote }}
1010{{- end }}
Original file line number Diff line number Diff line change @@ -14,5 +14,28 @@ for values_file in "$TEST_DIR"/values-*.yaml; do
1414 helm template test-release " $CHART_DIR " -f " $values_file " | kubeconform -strict -ignore-missing-schemas -summary
1515done
1616
17+ # Validate multiple passwords renders valid TOML
18+ echo " "
19+ echo " ==> Validating multiple passwords TOML output..."
20+ users_toml=$( helm template test-release " $CHART_DIR " -f " $TEST_DIR /values-multiple-passwords.yaml" \
21+ | yq -r ' select(.kind == "Secret" and .metadata.name == "test-release-pgdog") | .data["users.toml"]' \
22+ | base64 -d)
23+
24+ if echo " $users_toml " | grep -q ' passwords = \["one", "two"\]' ; then
25+ echo " passwords array rendered correctly"
26+ else
27+ echo " FAIL: passwords array not rendered correctly"
28+ echo " Got: $users_toml "
29+ exit 1
30+ fi
31+
32+ if echo " $users_toml " | grep -q ' password = "single_password"' ; then
33+ echo " single password rendered correctly"
34+ else
35+ echo " FAIL: single password not rendered correctly"
36+ echo " Got: $users_toml "
37+ exit 1
38+ fi
39+
1740echo " "
1841echo " ==> All tests passed!"
You can’t perform that action at this time.
0 commit comments