-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
main.go: Remove sleep during shutdown #777
Conversation
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.
question about passing wg as reference
main.go
Outdated
@@ -44,6 +44,8 @@ import ( | |||
"github.com/joho/godotenv" | |||
|
|||
// Backends need to be imported for their init() to get executed and them to register |
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.
this comment should be moved to where the imports are
main.go
Outdated
// Block waiting to renew the lease | ||
_ = MonitorLease(ctx, sm, bn) | ||
if !opts.kubeSubnetMgr { | ||
err = MonitorLease(ctx, sm, bn, wg) |
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 you be passing &wg
to MonitorLease
if you're passing the reference?
main.go
Outdated
@@ -339,10 +360,16 @@ func getConfig(ctx context.Context, sm subnet.Manager) (*subnet.Config, error) { | |||
} | |||
} | |||
|
|||
func MonitorLease(ctx context.Context, sm subnet.Manager, bn backend.Network) error { | |||
func MonitorLease(ctx context.Context, sm subnet.Manager, bn backend.Network, wg sync.WaitGroup) error { |
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.
same here, I think it should be wg *sync.WaitGroup
de8b7a7
to
719cc44
Compare
I amended the commits with the markups (since they were small). PTAL @gunjan5 |
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
No description provided.