From 4d4fb4447b4362678295a09dd3620b845b587bd3 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Mon, 2 Aug 2021 16:58:45 +0300 Subject: [PATCH] Always restart device plugin pod Until https://github.com/k8snetworkplumbingwg/sriov-network-device-plugin/issues/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. --- pkg/daemon/daemon.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index dec1e4d56..b58c78cbf 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -519,14 +519,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)