Skip to content

Conversation

@OlegErshov
Copy link

On-behalf-of: SAP [email protected]
This PR is intended to fix this finalization problem:

  1. The object has 2 finalizers. One from platform-mesh and another one from kcp (e.g core.platform-mesh.io/apibinding-finalizer and apis.kcp.io/apibinding-finalizer
  2. At the beginning of reconciliation an operator fetches an object which has 2 finalizers
  3. During the reconciliation the finalizer from kcp has been removed first
  4. Now the object in kubernetes has only 1 finalizer (core.platform-mesh.io/apibinding-finalizer ) , but in the operator's runtime we still have 2 finalizers ( core.platform-mesh.io/apibinding-finalizer and apis.kcp.io/apibinding-finalizer)
  5. When we apply the patch to remove platform-mesh's finalizer, we also add a new finalizer from the kcp, which has been removed from the cluster already
  6. As the result we've got a few errors about adding a finalizer during the object deletion

@OlegErshov OlegErshov requested review from a team as code owners November 12, 2025 08:08
@github-actions github-actions bot added the fix label Nov 12, 2025
@aaronschweig
Copy link
Contributor

aaronschweig commented Nov 12, 2025

Whilst I see the intention behind this PR, I am not sure if it is the right way to achieve the result.

Normally things like that are handled in controller-runtime in a way, that in case such a conflict occurs, the reconciliation starts again, fetching the fresh object (if still present), executing the idempotent logic again, and then removing the finalizer.

So the "right" option in my opinion would be not to re-fetch here - which could introduce a big number of data consistency issues introducing a last minute up to date version of an object which might was not the one being reconciled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants