-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Handle invalid selectors properly #107559
Conversation
/assign @deads2k |
016404e
to
c0af728
Compare
/triage accepted |
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.
How about these? Should they also continue instead of return?
kubernetes/pkg/controller/clusterroleaggregation/clusterroleaggregation_controller.go
Lines 100 to 103 in 3f0b6d3
runtimeLabelSelector, err := metav1.LabelSelectorAsSelector(&selector) | |
if err != nil { | |
return err | |
} |
selector, err := metav1.LabelSelectorAsSelector(c.LabelSelector) | |
if err != nil { | |
return nil, err | |
} |
no, both of those represent an object containing multiple selectors... it's reasonable to require all selectors in the object to be valid for the object to function correctly |
Not that I think anyone was really looking in the past, but as a side-effect of this, some messages will no longer be in the log about the failures. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brianpursley, deads2k, liggitt 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Many controllers and client listers assume we cannot encounter invalid selectors in persisted objects because they are validated. #99139 reported that the label selector validation is incomplete, and invalid values can be persisted.
This PR: