-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add filtering of watched resources #2378
Comments
@fabianvf would be great have your input here? |
Yeah this makes a ton of sense, especially if you've got a cluster-wide watch on something like secrets. If it's already easy to establish a watch with a selector in controller-runtime this would be as simple as adding a field to the ansible |
/assign @dmvolod |
This isn't as simple as it seems unfortunately. See kubernetes-sigs/controller-runtime#244. A naive workaround now would be to do the filtering client-side using a predicate. The obvious problem is that if your operator is watching chatty resources cluster-wide, there's going to be a lot of unnecessary traffic. |
/unassign @dmvolod |
@joelanford that's a shame, though we can at least add the config option and add a predicate that will filter based on the config, which will at least save users from needing to do a full python + ansible initialization before skipping the event. In the future when controller-runtime supports it we can replace the predicate with a more proper implementation. |
Looks like this is done. |
Feature Request
Is your feature request related to a problem? Please describe.
I would like my Ansible operator to watch some resources, for example pods, and I want it to run only on some specific pods, for example pods with some label.
Describe the solution you'd like
I would like to be able to add selectors in
watches.yaml
to specify selectors of the watched resources, e.g. labels.The text was updated successfully, but these errors were encountered: