-
Notifications
You must be signed in to change notification settings - Fork 74
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
✨ a client builder for manifestworks #273
✨ a client builder for manifestworks #273
Conversation
/assign @qiujian16 |
factory := workinformers.NewSharedInformerFactoryWithOptions(workClientSet, b.informerResyncTime, b.informerOptions...) | ||
informers := factory.Work().V1().ManifestWorks() | ||
manifestWorkLister := informers.Lister() | ||
namespacedLister := manifestWorkLister.ManifestWorks(b.clusterName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am worried that we have multiple thread write cache.Store at the same time. Is cache.Store thread safe? What happens if a thread is updating the spec and another is updating the status or finallizer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the informer cache is a thread safe store, when we update the spec/status/finallizer, all of these actions will be handled by the reflector , the reflector will call its store to update them, so I think it should be thread safe call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add some note here that client and informer is sharing the store in this implementation. We may need to revisit the implementation in the future. Ideally, the store should be only written from the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, added a todo here
Signed-off-by: Wei Liu <liuweixa@redhat.com>
924be45
to
8ceebeb
Compare
/approve leave to @morvencao to tag |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiujian16, skeeey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
/lgtm
cf1ead4
into
open-cluster-management-io:main
Summary
a client builder for manifestworks
Related issue(s)
Fixes #