Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aggarwal0009
Copy link
Contributor

Reason for Change:
This PR enables device plugin

Issue Fixed:

Requirements:

Notes:

@aggarwal0009 aggarwal0009 added cns Related to CNS. swift-v2 labels Aug 29, 2024
@aggarwal0009 aggarwal0009 requested review from a team as code owners August 29, 2024 23:37
}

// Wait before polling again
time.Sleep(defaultNodeInfoCRDPollInterval)
Copy link
Member

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 {
Copy link
Member

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.

Comment on lines +909 to +911
} else {
return
}
Copy link
Member

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().

Comment on lines +888 to +889
initialVnetNICCount := 0
initialIBNICCount := 0
Copy link
Member

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 {
Copy link
Member

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.

Copy link

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

@github-actions github-actions bot added the stale Stale due to inactivity. label Sep 18, 2024
@github-actions github-actions bot removed the stale Stale due to inactivity. label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cns Related to CNS. swift-v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants