Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Handle finalizers early in Reconciles #11286

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Oct 14, 2024

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #11105

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 14, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-area PR is missing an area label size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 14, 2024
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

/hold
will rebase once Fabrizio's PR is merged

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 14, 2024
@sbueringer sbueringer force-pushed the pr-move-finalizer-logic branch from b7ee8b6 to 1f9ec2e Compare October 14, 2024 10:05
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer added the area/util Issues or PRs related to utils label Oct 14, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Oct 14, 2024
@sbueringer sbueringer force-pushed the pr-move-finalizer-logic branch from 1f9ec2e to 7183826 Compare October 14, 2024 11:10
@sbueringer
Copy link
Member Author

Rebased

/hold cancel

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 14, 2024
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

return false, err
}

controllerutil.AddFinalizer(o, finalizer)
Copy link
Member

Choose a reason for hiding this comment

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

Nit, not for this PR.
I think we should stop calling the patch helper when it is easy to figure out that no changes have been applied, like in this case (this will avoid a few Mashal operations)

Copy link
Member Author

@sbueringer sbueringer Oct 14, 2024

Choose a reason for hiding this comment

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

Not sure I understand what you mean. In general I agree we shouldn't call the patch helper if we know that there is no change. But in this case there will always be a change?

(or do you mean just in general when using a func like AddFinalizer that easily tells us if there was a change?)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 14, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 52881545fdbf66982ddd56af5d8b4abbae0beec3

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit 7e2e9c4 into kubernetes-sigs:main Oct 14, 2024
30 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Oct 14, 2024
@sbueringer sbueringer deleted the pr-move-finalizer-logic branch October 14, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/util Issues or PRs related to utils cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants