UNCLASSIFIED - NO CUI

Skip to content

fix keycloak password templating

General MR

Summary

Fix templating of keycloak-values-secret when password starts with special characters

Reproduction Steps

1. Run helm template with values through stdin and extract the keycloak values secret

cat <<'EOF' | helm template test ./chart -f - | yq 'select(.metadata.name == "test-keycloak-values")'
addons:
  keycloak:
    enabled: true
    database:
      hostname: 'foo'
      password: "[testpassword123"
EOF

2. Expected Error Output

You should see YAML parsing errors in the defaults field:

stringData:
  defaults:
    |-
      Error: 'error converting YAML to JSON: yaml: line 38: did not find expected ',' or ']''

3. Verify the fix

After applying the fix (adding | quote to line 51), the same command should render valid YAML without errors.

Fix Applied

In chart/templates/keycloak/values.yaml:51:

# Before:
password: {{ coalesce .password "keycloak" }}

# After:
password: {{ coalesce .password "keycloak" | quote}}

This ensures password values are properly quoted regardless of special characters.

Linked Issue

Closes #2882 (closed)

Upgrade Notices

N/A

Edited by Christopher O'Connell

Merge request reports

Loading