Skip to content

Commit

Permalink
Merge pull request k8snetworkplumbingwg#472 from SchSeba/remove_drain…
Browse files Browse the repository at this point in the history
…_on_none_vfs

Re-introduce the check if the number of VFs is 0
  • Loading branch information
SchSeba authored Jul 13, 2023
2 parents 37ddcd4 + 6b946e9 commit 6a6f8d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/plugins/generic/generic_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ func needDrainNode(desired sriovnetworkv1.Interfaces, current sriovnetworkv1.Int
configured := false
for _, iface := range desired {
if iface.PciAddress == ifaceStatus.PciAddress {
// TODO: no need to perform further checks if ifaceStatus.NumVfs equals to 0
// once https://github.com/kubernetes/kubernetes/issues/109595 will be fixed
configured = true
if ifaceStatus.NumVfs == 0 {
glog.V(2).Infof("generic-plugin needDrainNode(): no need drain, for PCI address %s current NumVfs is 0", iface.PciAddress)
break
}
if utils.NeedUpdate(&iface, &ifaceStatus) {
glog.V(2).Infof("generic-plugin needDrainNode(): need drain, PF %s request update", iface.PciAddress)
glog.V(2).Infof("generic-plugin needDrainNode(): need drain, for PCI address %s request update", iface.PciAddress)
needDrain = true
return
}
glog.V(2).Infof("generic-plugin needDrainNode(): no need drain, expect NumVfs %v, current NumVfs %v", iface.NumVfs, ifaceStatus.NumVfs)
glog.V(2).Infof("generic-plugin needDrainNode(): no need drain,for PCI address %s expect NumVfs %v, current NumVfs %v", iface.PciAddress, iface.NumVfs, ifaceStatus.NumVfs)
}
}
if !configured && ifaceStatus.NumVfs > 0 {
Expand Down

0 comments on commit 6a6f8d8

Please sign in to comment.