Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: pgdog
version: v0.53
version: v0.54
appVersion: "0.1.37"
2 changes: 1 addition & 1 deletion templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = {{ .name | quote }}
database = {{ .database | quote }}
{{- if .passwords }}
passwords = {{ .passwords | toToml }}
passwords = [{{ range $i, $p := .passwords }}{{ if $i }}, {{ end }}{{ $p | quote }}{{ end }}]
{{- else if .password }}
password = {{ .password | quote }}
{{- end }}
Expand Down
23 changes: 23 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,28 @@ for values_file in "$TEST_DIR"/values-*.yaml; do
helm template test-release "$CHART_DIR" -f "$values_file" | kubeconform -strict -ignore-missing-schemas -summary
done

# Validate multiple passwords renders valid TOML
echo ""
echo "==> Validating multiple passwords TOML output..."
users_toml=$(helm template test-release "$CHART_DIR" -f "$TEST_DIR/values-multiple-passwords.yaml" \
| yq -r 'select(.kind == "Secret" and .metadata.name == "test-release-pgdog") | .data["users.toml"]' \
| base64 -d)

if echo "$users_toml" | grep -q 'passwords = \["one", "two"\]'; then
echo " passwords array rendered correctly"
else
echo " FAIL: passwords array not rendered correctly"
echo " Got: $users_toml"
exit 1
fi

if echo "$users_toml" | grep -q 'password = "single_password"'; then
echo " single password rendered correctly"
else
echo " FAIL: single password not rendered correctly"
echo " Got: $users_toml"
exit 1
fi

echo ""
echo "==> All tests passed!"
Loading