Fix global role binding name to be RFC 1123 compliant
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful

rancher2_global_role_binding.name must be a lowercase RFC 1123 label, but the
akP-* group keys are mixed-case, so apply failed with InvalidFormat 422.
Lowercase the name; keep the group principal id in original case to match the
Authentik group.
This commit is contained in:
2026-07-18 22:55:38 +10:00
parent 1dc43580f6
commit f2f41fc1c0
+4 -1
View File
@@ -29,7 +29,10 @@ resource "rancher2_auth_config_keycloak_oidc" "this" {
resource "rancher2_global_role_binding" "group" { resource "rancher2_global_role_binding" "group" {
for_each = var.global_role_bindings for_each = var.global_role_bindings
name = "akgroup-${each.key}" # Binding name must be an RFC 1123 label (lowercase); the group name may be
# mixed-case (akP-*), so lowercase it here. The principal id keeps the original
# case to match the group.
name = "akgroup-${lower(each.key)}"
global_role_id = each.value.global_role_id global_role_id = each.value.global_role_id
group_principal_id = "keycloakoidc_group://${each.key}" group_principal_id = "keycloakoidc_group://${each.key}"