-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
🐛 MatchingLabels: Make sure requests with invalid labels fail #882
Conversation
7a00dbd
to
4950d61
Compare
4950d61
to
1c4a481
Compare
Nice fix. Do you think it's worth adding an invalid call against a real server in client_test.go to catch regressions? I realize your unit test essentially is the server side behavior, so it's really a nit, but can't hurt? I'll defer to you. /lgtm |
I think its fine, the important part is that we verify that even on invalid input a selector is populated rather than getting an empty selector back. Even if this had an integration test, an actual apiserver could behave differently than the one used in the integration test. |
code LGTM, should this be a breaking change though? |
No, the previous behavior of "Return empty label selector that matches everything on invalid selector" is a bug and very unexpected. |
fair, we'll add some more details in the release notes for users |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, vincepri 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 |
Fixes #740
Following up on an idea by @lavalamp this PR makes
MatchingLabels
construct an invalid selector rather than a (valid) match all selector in case of invalid input, which means the server will reject the request./assign @alexeldeib @vincepri