Fix/remove dead nil selector check#231
Fix/remove dead nil selector check#231dorodb-web22 wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dorodb-web22 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @dorodb-web22. 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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
|
||
| // Process node against all applicable rules | ||
| r.Controller.processNodeAgainstAllRules(ctx, node) | ||
| if err := r.Controller.processNodeAgainstAllRules(ctx, node); err != nil { |
There was a problem hiding this comment.
Thanks for your PR. Please note this is also addressed here: #229. Can you coordinate with the other author?
There was a problem hiding this comment.
ah I see your original PR: #222. This possibly is carrying your earlier changes as well. Can you scope the changes in this PR to only nil check?
There was a problem hiding this comment.
@ajaysundark Good catch, I had accidentally branched from another PR instead of main. i have now force-pushed a cleaned-up version scoped only to the nil check in nodereadinessrule_controller.go. Thanks....
|
/ok-to-test |
43fbf88 to
fc5b44b
Compare
Description
metav1.LabelSelectorAsSelectoris called with&oldRule.Spec.NodeSelector, whereNodeSelectoris a struct value, not a pointer. It never returnsnil, nil; an empty struct yieldslabels.Everything(), which correctly matches all nodes. The subsequentif oldSelector == nilbranch was therefore dead code and could never be reached.Remove the nil check and call
oldSelector.Matches(...)directly.Related Issue
Fixes #230
Type of Change
/kind cleanup
Testing
make test
make lint
Checklist
Does this PR introduce a user-facing change?
NONE