-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🌱 Support new control plane label and taint #5919
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -980,6 +980,9 @@ func fakeNode(name string, options ...fakeNodeOption) *corev1.Node { | |||||||||||
p := &corev1.Node{ | ||||||||||||
ObjectMeta: metav1.ObjectMeta{ | ||||||||||||
Name: name, | ||||||||||||
Labels: map[string]string{ | ||||||||||||
labelNodeRoleControlPlane: "", | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now necessary because the old implementation of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are tests for it https://github.com/kubernetes-sigs/controller-runtime/blob/f20692b7ce2a9dda7eb298504a9c47aaf5a96544/pkg/client/fake/client_test.go#L314-L324 and it should be supported afaik. The code that does the selection is in https://github.com/kubernetes-sigs/controller-runtime/blob/4e7f0c968b90a306fb9ef22f8e92fa36b98b4ef1/pkg/cache/internal/cache_reader.go#L107-L108 — are we not using a cache here perhaps? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take a closer look. To be clear for the new code everything works fine. I think it's now mostly a question of why didn't we have to set the control plane node label with the old code. (aka is there something wrong with fake client or our usage of it) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay everything worked/works as expected. In the relevant unit test we're injecting the list result: cluster-api/controlplane/kubeadm/internal/workload_cluster_conditions_test.go Lines 84 to 88 in 5026786
Previously, we didn't have to set the control plane label as the result of the list was automatically the list of control plane nodes. As we're now iterating through the result and checking for the label it became relevant. |
||||||||||||
}, | ||||||||||||
}, | ||||||||||||
} | ||||||||||||
for _, opt := range options { | ||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.