-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Removing dead code in labels package and changing LabelSelector type #5769
Conversation
@sdminonne please see #5771 and the change smarterclayton@1c350cb that is part of #5763 |
We use RequiresExactMatch in OpenShift - what's the replacement for ParseSelector |
Nm on RequiresExactMatch - that's in fields. It's fine to remove from labels. |
@smarterclayton working on this. |
Thanks a lot for deleting all the dead code. |
It's convenient to deal with the nil, although it can be confusing that nil LabelSelector and nil Selector do different things. We do need to treat nil Selector special in services. |
@nikhiljindal I didn't test it but when I saw this https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/service/endpoints_controller.go#L54 I start to think that we would handle nil label selector. At the moment the service.spec.selector is still a map but we may want to move to a selector. @smarterclayton thanks for this. Would you prefer to have LabelSelector defined as a slice of Selector(s)? |
ok. Fine with handling nil LabelSelector if its easy to deal with. |
Removing dead code in labels package and changing LabelSelector type
@nikhiljindal thanks. |
Main modification of this PR: LabelSelector type is changed to be a type []Requirement instead of struct { Requirements: []Requirement } necessary to handle the
nil
selector.Removed the andTerm hasTerm struct no more used. As suggested by @nikhiljindal #5171 (comment)
Other removed code:
OneTermEqualSelector
andRequiresExactMatch
simply not used for labelsParseSelector
not used anymoreSelectorFromSet
does not return and error in case non valid (key/value) pair are added. This part will be handled during the API modification of Generalize label selectors #341 as discussed here Generalize label selectors #341 (comment).