-
Notifications
You must be signed in to change notification settings - Fork 1.2k
✨ Migrate controllerutil AddFinalizer and RemoveFinalizer to controllerutil.Object and deprecate *WithError functions #962
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
Conversation
Hi @dmvolod. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@alvaroaleman , as you suggested, I've opened a separate issue and PR which is migrating to the controllerutil.Object in RemoveFinalizer and AddFinalizer. Also removed *WithError as not needed anymore. Please have a look at this changes. Thank you. |
@@ -248,19 +247,8 @@ func AddFinalizer(o metav1.Object, finalizer string) { | |||
o.SetFinalizers(append(f, finalizer)) | |||
} | |||
|
|||
// AddFinalizerWithError tries to convert a runtime object to a metav1 object and add the provided finalizer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @dmvolod I think it would be better for now to leave the WithError
funcs and just add a comment that they are deprecated and shouldn't be used. We can remove them when we also merge other braking changes. AFAIK right now we do not have any breaking changes planned.
/ok-to-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for feedback, @alvaroaleman
I've changed just common functions and marked *WithError as deprecated
…erutil.Object and deprecate *WithError funcs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/assign @vincepri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dmvolod, vincepri 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 |
In order to allow for a broader adoption of ContainsFinalizer, RemoveFinalizer and AddFinalizer and remove a BC break introduced to 0.5.x I switched the method back to the `metav1.Object`. After reading kubernetes-sigs#959 and kubernetes-sigs#962 I'm unable to understand the benefit of requiring `runtime.Object` so I propose to revert the BC break and possible panic on line 285.
As #898 introduces controllerutil.Object interface this fix migrates controllerutil AddFinalizer and RemoveFinalizer to the controllerutil.Object interface and remove *WithError functions as they are not needed anymore as checks are performing on the compile time.
Fixes #959