fix(keycloak): read realm lookups by name at plan time #624

Sammanfogat
supernaut sammanfogade 1 incheckning från fix/keycloak-realm-data-sources in i main 2026-10-09 06:56:14 +00:00
Ägare

The realm lookups referenced the realm resource. Any pending realm change deferred them to apply time. Their outputs became unknown, which planned spurious updates and replacements. The deferred realm-management lookup also used the plan-time admin token, which had expired by apply (401).

The lookups now name the realm by a constant (local.realm), so they resolve at plan time.

A new realm needs a targeted first apply. The runbook and opentofu/README.md document it:

tofu -chdir=opentofu/keycloak apply -target=keycloak_realm.bitborg -var-file=env/<env>.tfvars

After merge: plan on staging. Expect only the reconciler view-realm role create and the SMTP update.

Refs #571

The realm lookups referenced the realm resource. Any pending realm change deferred them to apply time. Their outputs became unknown, which planned spurious updates and replacements. The deferred realm-management lookup also used the plan-time admin token, which had expired by apply (401). The lookups now name the realm by a constant (`local.realm`), so they resolve at plan time. A new realm needs a targeted first apply. The runbook and `opentofu/README.md` document it: ``` tofu -chdir=opentofu/keycloak apply -target=keycloak_realm.bitborg -var-file=env/<env>.tfvars ``` After merge: plan on staging. Expect only the reconciler `view-realm` role create and the SMTP update. Refs #571
supernaut lade till 1 incheckning 2026-10-09 06:51:58 +00:00
fix(keycloak): read realm lookups by name at plan time
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m58s
8bf7678420
The realm lookups referenced the realm resource, so any pending realm change
deferred them to apply time. Their outputs became unknown, which planned
spurious updates and replacements, and the deferred realm-management lookup
used the plan-time admin token and failed with 401 once it had expired.

They now name the realm by a constant. A new realm needs a targeted first
apply, documented in the runbook.

Refs #571
supernaut sammanfogade incheckning 93390f5786 till main 2026-10-09 06:56:14 +00:00
supernaut tog bort grenen fix/keycloak-realm-data-sources 2026-10-09 06:56:14 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra!624
Ingen beskrivning angiven.