-
Notifications
You must be signed in to change notification settings - Fork 38.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
fixes the way the informers are started in sample controller pkg #69636
fixes the way the informers are started in sample controller pkg #69636
Conversation
/assign @deads2k |
go kubeInformerFactory.Start(stopCh) | ||
go exampleInformerFactory.Start(stopCh) | ||
kubeInformerFactory.Start(stopCh) | ||
exampleInformerFactory.Start(stopCh) |
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.
👍
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.
we should add comments here explaining this doesnt need to go in a go routine for so and so reason, more so because lot of first timers come here to copy code
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.
sgtm
go kubeInformerFactory.Start(stopCh) | ||
go exampleInformerFactory.Start(stopCh) | ||
kubeInformerFactory.Start(stopCh) | ||
exampleInformerFactory.Start(stopCh) | ||
|
||
if err = controller.Run(2, stopCh); err != nil { |
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.
Shouldn't this be run as a go routine though?
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 it is okay, the main func will stop at this method as it essentially runs the controller and blocks until the stopCh is closed.
/kind bug |
/assign @yliaog |
a2f5bb9
to
e55ca64
Compare
added the comment. PTAL |
/lgtm |
Going to close + reopen so tests run again. /close |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: munnerz, p0lyn0mial 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 |
@nikhita: Closing this PR. 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. |
/reopen |
@nikhita: Reopening this PR. 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. |
What this PR does / why we need it: there is no need to run
informerFactory.Start
method in a separategoroutine
. The method is non-blocking and runs all registered informers in a dedicatedgoroutine
.Release note: