Skip to content

Conversation

zmotso
Copy link
Member

@zmotso zmotso commented Jul 26, 2024

Pull Request Template

Description

Setting ownerReference with controller:true for Keycloak resources has disadvantages:

  • controller: true should be set for resources created by a controller. For example, we create a Deployment, and the controller creates a ReplicaSet with an ownerReference to the Deployment. In our case, we create resources separately, and the Keycloak controller isn't responsible for their creation.
  • ArgoCD doesn't remove resources with controller: true. It considers another controller responsible for them. If we remove the ArgoCD environment that contains KeycloakClient, this CR won't be removed by either ArgoCD or the Keycloak operator.

This change breaks the automatic deletion of CRs if related Keycloak/KeycloakRealm is removed.
Now, it isn't the responsibility of the keycloak operator.

Fixes #71

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist:

  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Pull Request contains one commit. I squash my commits

@zmotso zmotso added the enhancement New feature or request label Jul 26, 2024
@zmotso zmotso self-assigned this Jul 26, 2024
@zmotso zmotso requested a review from a team as a code owner July 26, 2024 11:29
Setting ownerReference with controller:true
for Keycloak resources has disadvantages:
- `controller: true` should be set for resources created by a controller.
  For example, we create a Deployment, and the controller creates
  a ReplicaSet with an `ownerReference` to the Deployment.
  In our case, we create resources separately, and
  the Keycloak controller isn't responsible for their creation.
- ArgoCD doesn't remove resources with `controller: true`.
  It considers another controller responsible for them.
  If we remove the ArgoCD environment that contains KeycloakClient,
  this CR won't be removed by either ArgoCD or the Keycloak operator.

This change breaks the automatic deletion of CRs
if related Keycloak/KeycloakRealm is removed.
Now, it isn't the responsibility of the keycloak operator.
Copy link
Member

@SergK SergK left a comment

Choose a reason for hiding this comment

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

let's have a discussion

@SergK
Copy link
Member

SergK commented Dec 2, 2024

postpone for now

@zmotso zmotso closed this May 6, 2025
@zmotso
Copy link
Member Author

zmotso commented May 6, 2025

Implementation: #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Remove OwnerRef from keycloak client or add bool in crd to diasble it.
2 participants