Skip to content

Commit

Permalink
Always restart device plugin pod
Browse files Browse the repository at this point in the history
Until k8snetworkplumbingwg/sriov-network-device-plugin#276
wiill be fixed we need to restart device plugin pod each time after
SR-IOV Network Operator plugin applied. It's needed because plugin
could change a number of VF resources even if config is not changed.

(cherry picked from commit 4ebf517)
  • Loading branch information
e0ne authored and wizhaoredhat committed Jun 5, 2023
1 parent 9e7ab95 commit a40e5c1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,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

0 comments on commit a40e5c1

Please sign in to comment.