-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 Fix MachinePool node taint patching #8462
🐛 Fix MachinePool node taint patching #8462
Conversation
/cherry-pick release-1.4 I'm working on adding unit tests for this (it's not trivial because the unit tests are non existent at the moment) + testing this patch with kubernetes-sigs/cluster-api-provider-azure#3378 |
@CecileRobertMichon: once the present PR merges, I will cherry-pick it on top of release-1.4 in a new PR and assign it to you. In response to this:
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. |
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: 6a083f25d17c237e3fc4c020d99039cae1463052
|
d1282cf
to
875d36a
Compare
clusterv1.OwnerKindAnnotation: mp.Kind, | ||
clusterv1.OwnerNameAnnotation: mp.Name, | ||
} | ||
// Add annotations and drop NodeUninitializedTaint. |
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.
this is the real change here (line 225-228). Everything else is just extracting the code into a function so it can be unit tested.
875d36a
to
39a84c4
Compare
Added unit tests. Had to extract the patching code into a helper function that takes a client so it could be unit tested. |
39a84c4
to
3095518
Compare
Looks good to me! 🚀 |
/retest |
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!
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
Thank you @CecileRobertMichon 🙂
LGTM label has been added. Git tree hash: 8d7f9ff4f3277b16c8a67df3bf99806bd79b40a5
|
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.
good catch!
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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 |
@CecileRobertMichon: new pull request created: #8468 In response to this:
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. |
/area machinepool |
What this PR does / why we need it: Fixes flake observed in CAPZ testing with CAPI v1.4.0 where MachinePool Nodes
{node.cluster.x-k8s.io/uninitialized: }
taints don't get removed right away (~15 minute delay). The root cause is that we are escaping the second part of theif annotations.AddAnnotations(node, desired) || taints.RemoveNodeTaint(node, clusterv1.NodeUninitializedTaint)
when the first part if true (see https://play.golang.com/p/i-6vDeSeeBE). This results in the controller returning no error without having patched the taints. Only after the resyncPeriod does the controller get requeued and Taints finally updated.Credits to @nawazkh @willie-yao @jackfrancis for helping me find this
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #8442