-
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
Consider making cache.internal.CacheReader
accessible for users
#247
Comments
/kind feature |
#327 addresses this from the opposite direction |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. 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. |
removed an extra 'dep ensure' step in init project
The documentation at https://book.kubebuilder.io/beyond_basics/using_client_go_informers.html shows how to wire in informers from the
client-go
package, but due to the behavior of the client provided to controllers (creates a watch when get/list is used), it means the story gets complicatedSee below for an example where a custom informer is used, but having the ability to create a
CacheReader
would be very useful when it comes to actually using it.In this scenario I cannot use the
mgr.GetClient()
to do any reads ofSecrets
because that would set up a watch (thus why bother with the custom informer?), so the fall back would be working with the old informer api's instead of the easier to useclient.Reader
interfaces, which would be possible if I could dosecretsCache := NewCacheReader(informer.GetIndexer(), groupVersionKind)
Being able to explicitly ask for caching / non-caching behavior as discussed in #180 combined with first-class support of filtered watches (#244) might not fully solve this case, as there could be multiple different informers for the same GVK, but with different filters (overlapping or not), meaning the choice of informer/cache perhaps should be more explicit than first thought? (this is also mentioned at the bottom of #244). By letting users easily create their own
CacheReaders
it at least makes it possible to do this today without gating it on similar/getting built-in support for this in the main client(s) provided by controller-runtime to the custom controllers, though having to use more than one client to achieve this is unfortunate.The text was updated successfully, but these errors were encountered: