Skip to content
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

Read(List/Get) objects from the informer cache #258

Closed
devdattakulkarni opened this issue May 16, 2018 · 4 comments
Closed

Read(List/Get) objects from the informer cache #258

devdattakulkarni opened this issue May 16, 2018 · 4 comments
Assignees

Comments

@devdattakulkarni
Copy link

devdattakulkarni commented May 16, 2018

Currently the SDK provides a List function
https://github.com/operator-framework/operator-sdk/blob/master/pkg/sdk/query.go#L59

which is used to setup the List and Watch
https://github.com/operator-framework/operator-sdk/blob/master/pkg/sdk/informer.go#L65

when creating the SharedIndexInformer
https://github.com/operator-framework/operator-sdk/blob/master/pkg/sdk/informer.go#L54

The sample-controller approach (https://github.com/kubernetes/sample-controller) uses 'Listers'
https://github.com/kubernetes/sample-controller/blob/master/pkg/client/listers/samplecontroller/v1alpha1/foo.go#L48

for querying Objects from the local Index.

So I was wondering why Listers are not included in the design of the SDK?

Using a List function which always makes call to the API server can cause load on the server.
Listers would help reduce these calls, no?

@jhernandezb
Copy link
Contributor

jhernandezb commented May 18, 2018

Just got into the same question, specially if I'm watching different kind of objects I'd like to query from the local cache.

@spahl
Copy link
Contributor

spahl commented Jun 5, 2018

Holding off until #169 is done. This will also probably require a bit of discussion about design.

@hasbro17 hasbro17 changed the title Resource List vs. Lister + Indexer Read(List/Get) objects from the informer cache Oct 1, 2018
@hasbro17
Copy link
Contributor

hasbro17 commented Oct 1, 2018

With the planned refactoring to use the controller-runtime #382 , the provided split-client should allow reading(List/Get) objects from the informer cache.

@hasbro17
Copy link
Contributor

Resolved via #382
See the default client doc or the delegating client for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants