-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Field selector is not applied even when resource fields are matching #3573
Comments
Could you please quickly check if this is still reproducible in #3562 🙏 ? Maybe we can tackle the issue in scope of that PR. |
I'm testing in scope of #3562, but this is not working here either. Are you sure this test was working on 4.9? Field selector support was added in #3375, and I don't think we supported any kind of field selection prior to that (in CRUD mode). Now the selection takes place and we are a little more restrictive. If that's the test you have, probably the reason it passed before is that you are just not checking the opposite (i.e. add another event to the server, the list should still only return one entry ----> my guess is that in 4.9 it will return 2) |
Further support can be included in the MockServer to support additional fields, but this would be still kind of complex and limitless. e.g. for the Event we could use reflection to infer the top level fields and add attributes for those (if they represent primitive types) |
@manusa Thanks for confirming. I also did some tests with #3562 and I have observed the same.
I am sure that our unit test was working with 4.9 but you are right: we did not check the opposite and field selectors were not considered at all (i.e. all events in the requested namespace were returned and our test did simply only use events matching the field selector). |
This is what I suspected after checking the code. TL;DR field selector was not supported in 4.9, and now it's only partially supported. We can keep this open to explore the addition of attribute computation/extraction for resources handled by the CRUD dispatcher. However, I really don't see a proper way to move forward with this. |
I understand that adding support for field selectors (and maybe other features as well) to the mock server might be really complex and limitless (and perhaps even harder to maintain..). What do you think about to at least extend the documentation so that such limitations are listed there? Once documented, this issue could be closed accordingly. |
That'd be great :) |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
After upgrading from 4.9.2 to 5.9.0, I have observed that one of our unit tests (which is using
KubernetesServer
) is failing. It seems that object are not returned when using the Event API with field selectors. I did not yet checked other API's neither whether it's limited to theKubernetesServer
.Following a small reproduction unit test which illustrates the problem:
Logs from the test execution:
Please let me know if further information are required.
The text was updated successfully, but these errors were encountered: