Closed creckord closed 1 year ago
Thanks (again) for reporting this issue. Keycloak 19 was the last version that included this legacy Operator, and with the release of Keycloak 20 the Operator reached EOL and this repository will be archived, please see our blog post on this topic. If this issue is still valid for the Realm Operator, please re-open it there. Thanks for your understanding. And be sure to check out our new Operator!
Describe the bug
Keycloak defines a couple of default client protocol mappers based on the client's protocol. For OIDC, it automatically creates mappers for
Client ID
,Client IP Address
andClient Host
on the first token request if they don't exist.This clashes with the operator's reconciliation run: if the corresponding KeycloakClient definition does not include these required mappers, the operator will delete them, the next token request will recreate them, etc ad nauseam.
Usually, this shouldn't be too harmful, however this is where Keycloak #10417 - Race when creating client protocol mappers enters the stage. Due to constantly triggering the recreation of these mappers, the likelihood of triggering the bug increases immensely, especially for "popular" clients that see many token requests. This in turn breaks reconciliation and renders further client updates impossible:
The Keycloak bug aside, I don't think the operator should delete required default mappers, even if they are not included in the CRD.
I'm not sure what the state of the keycloak-operator project is right now, given that it has been deprecated. But seeing as the new operator is currently far from a replacement, it would be great if we could still get a fix in here.
Version
Keycloak 18.0.1 / Operator 18.0.2-legacy
Expected behavior
The operator does not delete default protocol mappers mandated by the client's protocol, even if they are not explicitly included in the client's CRD
Actual behavior
All default protocol mappers not explicitly included in the client's CRD get deleted during reconciliation.
How to Reproduce?
audience-mapping
definedClient ID
,Client IP Address
andClient Host
have been createdAnything else?
No response