-
Notifications
You must be signed in to change notification settings - Fork 237
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
Instantiate Device Plugin #2979
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
// Wait before polling again | ||
time.Sleep(defaultNodeInfoCRDPollInterval) |
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.
time.Ticker
(remembering to defer Stop()
) is better here since it does not delay the context cancellation in the event that happens during the cooldown period.
|
||
// Start device plugin manager in a separate goroutine | ||
go func() { | ||
for { |
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 for
seems out of place if the intention is to restart pluginManager
in the event of an error. It might also be wise to have a circuit breaker if it continually fails.
} else { | ||
return | ||
} |
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 construction is what makes me think the for
should, at least, be more tightly placed around the pluginManager
's Run()
.
initialVnetNICCount := 0 | ||
initialIBNICCount := 0 |
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're not writing to these, and assigning them off to appease the magic number linter, they should probably be consts.
} | ||
|
||
// Check if the status is set | ||
if !reflect.DeepEqual(nodeInfo.Status, mtv1alpha1.NodeInfoStatus{}) && len(nodeInfo.Status.DeviceInfos) > 0 { |
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.
github.com/google/go-cmp/cmp.Equal
is better than reflect.DeepEqual
for a lot of reasons. It's a drop-in replacement, and it does the right thing more consistently.
This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days |
Reason for Change:
This PR enables device plugin
Issue Fixed:
Requirements:
Notes: