-
Notifications
You must be signed in to change notification settings - Fork 241
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
cns/service/main.go
Outdated
} | ||
|
||
// 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.
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.
updated
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 made this recommendation prior to learning that cmp was intended for tests only. Given that the intention here is to test whether this type is a zero value, I believe it should be sufficient to test whether nodeInfo.Status.DeviceInfos != nil && len(nodeInfo.Status.DeviceInfos) > 0
. Second opinion might be nice though. @rbtr ?
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 |
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 |
Pull request closed due to inactivity. |
Signed-off-by: aggarwal0009 <[email protected]>
@aggarwal0009 did not see you had updated this. Please hit the re-review button in the future so I see this. |
Reason for Change:
This PR enables device plugin
Issue Fixed:
Requirements:
Notes: