Skip to content

Commit 55bfe0f

Browse files
committed
fix(keycloak): reword comments to avoid kcc substitutor false matches
kcc resolves $(env:VAR) placeholders via Apache Commons StringSubstitutor over the whole file BEFORE parsing as YAML, so even comments are scanned for unresolved variables. The previous comment block in keycloak_defaults.yaml literally described the placeholder pattern as "$(env:VAR)", which kcc treated as a real reference and failed with "Cannot resolve variable 'env:VAR' (enableSubstitutionInVariables=true)" before applying anything. Rewords the comment to describe the syntax without writing the literal shape, and adds an explicit warning so future editors don't reintroduce the trap. Caught during E2E on the refactored branch: the new keycloak-config-import Secret carried the original comment verbatim, so the kcc Job failed-fast on every retry until the comment was sanitized. Post-fix E2E (kind-nebari-local, fresh deploy) ran the kcc Job to completion in seconds and produced the expected realm state (all 7 default scopes on both realm and argocd client, both argocd-admins/argocd-viewers groups, admin user member of argocd-admins).
1 parent 30a05a8 commit 55bfe0f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

pkg/argocd/keycloak_defaults.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
# Keycloak.
1010
#
1111
# The gitops repo never sees this content. Realm structure and any
12-
# inline credentials (none currently — we use $(env:VAR) placeholders)
13-
# stay inside the cluster's Secret store.
12+
# inline credentials (none currently; secret-bearing fields use kcc's
13+
# variable-substitution syntax) stay inside the cluster's Secret store.
1414
#
15-
# `$(env:VAR)` placeholders are substituted by kcc at apply time from env
16-
# vars set on the Job (see templates/manifests/keycloak/realm-setup-job.yaml).
17-
# `{{ .Domain }}` is rendered by Go's text/template at NIC deploy time.
15+
# kcc resolves placeholders via Apache Commons StringSubstitutor BEFORE
16+
# parsing the file as YAML. That means even comments are scanned for
17+
# unresolved variables, so do NOT write the literal placeholder shape
18+
# inside any comment in this file or kcc will fail with
19+
# "Cannot resolve variable" before applying anything. The actual
20+
# placeholders live in field values below.
21+
# {{ .Domain }} is rendered by Go's text/template at NIC deploy time.
1822
realm: nebari
1923
enabled: true
2024
displayName: Nebari

0 commit comments

Comments
 (0)