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

Bug 2015481: Sync upstream: 2021-10-20 #570

Merged
merged 2 commits into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,14 @@ func (dn *Daemon) nodeStateSyncHandler(generation int64) error {
}

if !reqReboot {
// Apply generic_plugin last
err = dn.LoadedPlugins[GenericPlugin].Apply()
if err != nil {
glog.Errorf("nodeStateSyncHandler(): generic_plugin fail to apply: %v", err)
return err
plugin, ok := dn.LoadedPlugins[GenericPlugin]
if ok {
// Apply generic_plugin last
err = plugin.Apply()
if err != nil {
glog.Errorf("nodeStateSyncHandler(): generic_plugin fail to apply: %v", err)
return err
}
}
}

Expand All @@ -519,14 +522,11 @@ func (dn *Daemon) nodeStateSyncHandler(generation int64) error {
}

// restart device plugin pod
if reqDrain || latestState.Spec.DpConfigVersion != dn.nodeState.Spec.DpConfigVersion {
glog.Info("nodeStateSyncHandler(): restart device plugin pod")
if err := dn.restartDevicePluginPod(); err != nil {
glog.Errorf("nodeStateSyncHandler(): fail to restart device plugin pod: %v", err)
return err
}
glog.Info("nodeStateSyncHandler(): restart device plugin pod")
if err := dn.restartDevicePluginPod(); err != nil {
glog.Errorf("nodeStateSyncHandler(): fail to restart device plugin pod: %v", err)
return err
}

if anno, ok := dn.node.Annotations[annoKey]; ok && (anno == annoDraining || anno == annoMcpPaused) {
if err := dn.completeDrain(); err != nil {
glog.Errorf("nodeStateSyncHandler(): failed to complete draining: %v", err)
Expand Down