-
Notifications
You must be signed in to change notification settings - Fork 295
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
🐛 Small test fix. Remove OwnerReference & Check for Finalizers being empty #3178
Conversation
Welcome @erwin-kok! |
Hi @erwin-kok. 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-sigs/prow repository. |
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: neolit123 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 |
/ok-to-test thanks |
Thanks @neolit123 ! |
Isn't the proper fix to check in line 141 that the expected ownerreference is there instead of relying on a >0 check? |
You are right, better to check the expected OwnerReference. I changed the code accordingly, and also for the Finalizer (check the expected Finalizer i.s.o. relying on >0). Can you have another look @chrischdi ? Thanks! |
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
LGTM label has been added. Git tree hash: a2828baec99eebadaec702d6f34187badfacde1d
|
Thanks @erwin-kok for contributing this improvement! 🎉 |
/hold |
/hold cancel |
Two small fixes:
The secret was created with an OwnerReference. Later on (line ~141) it is checked if the controller sets the OwnerReference by counting the number of OwnerReferences. However, this is always > 0 since the OwnerReference was explicitly set before, so this check always passes. Removed the initial OwnerReference and counting the ones set by the controller.
Line ~237 it is stated: "should remove vspherecluster finalizer if the secret does not exist". However, it was not checked whether the Finalizers are actually empty. Added this check.