8000 Remove operator version-tolerant workaround by Copilot · Pull Request #53065 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Remove operator version-tolerant workaround - #53065

Merged
vmuzikar merged 2 commits into
mainfrom
copilot/remove-operator-version-workaround
Sep 25, 2026
Merged

vmuzikar merged 2 commits into
mainfrom
copilot/remove-operator-version-workaround

Conversation

Copilot AI commented Sep 22, 2026 •
Copy link
Copy Markdown
Contributor

The operator still carried a local ownerReference apiVersion workaround that was added until the Java Operator SDK fix became available. This change drops that local compatibility layer and relies on the SDK’s upstream secondary-to-primary mapping behavior.

  • Description

    • Remove VersionTolerantCRUDKubernetesDependentResource.
    • Switch CRUD-based operator dependents back to the standard JOSDK CRUDKubernetesDependentResource.
    • Remove custom mapper overrides from non-CRUD dependents that no longer need local compatibility logic.
  • Coverage

    • Keep the existing CRD upgrade reconciliation coverage.
    • Add focused controller tests for legacy owner references on:
      • admin Secret
      • realm import Job
  • Example

    // before
    public class KeycloakServiceDependentResource
            extends VersionTolerantCRUDKubernetesDependentResource<Service, Keycloak> {
    }
    
    // after
    public class KeycloakServiceDependentResource
            extends CRUDKubernetesDependentResource<Service, Keycloak> {
    }

Copilot AI linked an issue Sep 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Remove operator version tolerant workaround Remove operator version-tolerant workaround Sep 22, 2026
Copilot AI requested a review from shawkins September 22, 2026 14:12
@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.actions.TermsAndConditionsTest#termsAccepted

Keycloak CI - Forms IT (firefox)

java.lang.RuntimeException: Could not create statement
	at org.jboss.arquillian.junit.Arquillian.methodBlock(Arquillian.java:307)
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:160)
	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:344)
	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:48)
...

Report flaky test

org.keycloak.testsuite.actions.TermsAndConditionsTest#termsDeclinedAccount

Keycloak CI - Forms IT (firefox)

java.lang.RuntimeException: Could not create statement
	at org.jboss.arquillian.junit.Arquillian.methodBlock(Arquillian.java:307)
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:160)
	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:344)
	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:48)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreported flaky test detected, please review

@shawkins
shawkins marked this pull request as ready for review September 22, 2026 15:45
@shawkins
shawkins requested review from a team as code owners September 22, 2026 15:45
Copilot AI balanced review requested due to automatic review settings September 22, 2026 15:45
Copilot AI and others added 2 commits September 22, 2026 11:46
Co-authored-by: shawkins <2475669+shawkins@users.noreply.github.com>
Co-authored-by: shawkins <2475669+shawkins@users.noreply.github.com>
@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the test is overkill but it's fine to have it to guard against a regression.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The upstream SDK behavior matches the removed workaround, and focused tests cover both affected non-CRUD dependents.

Review effort: Balanced
Findings: None

What changed in this PR

Removes the operator’s local version-tolerant owner-reference workaround in favor of the equivalent upstream Java Operator SDK behavior.

Changes:

  • Replace the custom CRUD base class with the standard SDK implementation.
  • Remove custom mapper overrides and add focused legacy owner-reference tests.
File Description
OwnerReferenceMappingTest.java Tests legacy mappings for admin secrets and realm-import jobs.
VersionTolerantCRUDKubernetesDependentResource.java Removes the obsolete compatibility class.
KeycloakUpdateJobDependentResource.java Uses the SDK CRUD base class.
KeycloakServiceMonitorDependentResource.java Uses the SDK CRUD base class.
KeycloakServiceDependentResource.java Uses the SDK CRUD base class.
KeycloakRealmImportSecretDependentResource.java Uses the SDK CRUD base class.
KeycloakRealmImportJobDependentResource.java Removes the custom mapper override.
KeycloakNetworkPolicyDependentResource.java Uses the SDK CRUD base class.
KeycloakIngressDependentResource.java Uses the SDK CRUD base class.
KeycloakDiscoveryServiceDependentResource.java Uses the SDK CRUD base class.
KeycloakDeploymentDependentResource.java Uses the SDK CRUD base class.
KeycloakAdminSecretDependentResource.java Removes the custom mapper override.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@shawkins
shawkins force-pushed the copilot/remove-operator-version-workaround branch from 8e43743 to 87327cf Compare September 22, 2026 15:50
@shawkins
shawkins requested a review from a team September 23, 2026 12:08
@vmuzikar
vmuzikar merged commit 78ce22a into main Sep 25, 2026
102 of 104 checks passed
@vmuzikar
vmuzikar deleted the copilot/remove-operator-version-workaround branch September 25, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove operator version tolerant workaround

4 participants

0