-
Notifications
You must be signed in to change notification settings - Fork 183
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
[V2] refactor: start informers in one place #1607
[V2] refactor: start informers in one place #1607
Conversation
Hi @hccheng72. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/assign @sunpa93 |
e8430d4
to
11c93b3
Compare
/ok-to-test |
@@ -461,7 +465,7 @@ func (d *DriverV2) registerAzDriverNodeOrDie(ctx context.Context) { | |||
|
|||
nodeSelector := fmt.Sprintf("metadata.name=%s", d.NodeID) | |||
|
|||
azdiskInformer := azdiskinformers.NewSharedInformerFactoryWithOptions( | |||
azdiskInformerFactory := azdiskinformers.NewSharedInformerFactoryWithOptions( |
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.
Since this method starts a member informer of DriverV2
, I am wondering if we should refactor and start it at the beginning of driver setup with the rest of the informers if d.config.NodeConfig.Enabled
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 don't include it to this refactoring for now. Since this informer has an additional need for Lister()
method here, I don't see many benefits to combine it with other informers. We could reconsider if we have a better idea.
11c93b3
to
0e05833
Compare
52dfee5
to
4ae562b
Compare
4ae562b
to
90e9574
Compare
90e9574
to
10e86f0
Compare
@@ -475,7 +481,7 @@ func (d *DriverV2) registerAzDriverNodeOrDie(ctx context.Context) { | |||
}, | |||
}) | |||
|
|||
go azdiskInformer.Start(ctx.Done()) | |||
azdiskInformerFactory.Start(ctx.Done()) |
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 utilize azureutils.StartAndWaitForCacheSync
instead of manually starting the informer here.
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.
If we want to use azureutils.StartAndWaitForCacheSync
, we need to create an object as GenericInformer interface. But this informer needs Lister()
method here, we need to add this method/field to GenericInformer interface and GenericAzInformerInfo struct that would cause all other informers need to initiate lister
field which won't be used. That's why I manually start this informer. Any other suggestion?
10e86f0
to
c9806d5
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edreed, hccheng72 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Start informers centrally and share them with crdprovisioner and controllers to prevent dependency.
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: