-
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
Listing objects with a label selector that exceeds 63 characters returns non-matching objects and no error #740
Comments
From a little bit of debugging, I think this is what is happening:
There are some selector parsing functions we could make use of while setting labels in I'll defer to @DirectXMan12 for his input on how best to solve this. |
I suspect
|
I doubt it because there is another function that assumes a pre-validated set: https://github.com/kubernetes/apimachinery/blob/3253b0a30d67e7e362b8615e463156bac729c82f/pkg/labels/selector.go#L893-L894 This one might just be an oversight upstream. Anyway, I created kubernetes/kubernetes#86792 to track it. |
/priority awaiting-more-evidence Might need more investigation around the issue reported upstream. The issue might not be fixed in controller-runtime. |
@vincepri: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions 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/test-infra repository. |
I think we have to deprecate We need to instead have something like |
I was investigating a bug in a controller where the wrong objects were being deleted during reconciliation. Upon closer inspection, it looks like the List() method was returning objects that didn't match the label selector provided, and that this occurs when the label selector exceeds the 63 character limit.
While an error is returned from the API in this case, List() returns all objects of the type passed in.
I've managed to reproduce this behavior with a minimal example with v0.4.0 of controller-runtime (against a kind cluster):
Setup
Test function
Test
While it's possible to avoid this issue in the controller, this still seems like unexpected behavior from the client.
The text was updated successfully, but these errors were encountered: