Skip to content

Commit

Permalink
Re-introduce the check if the number of VFs is 0
Browse files Browse the repository at this point in the history
now that the issue with kubelet with fixed all the way to k8s 1.25
we can add again the check if the number of existing vfs is 0
there is no need to drain the node because there are no workloads
running with vfs from that nic

Signed-off-by: Sebastian Sch <[email protected]>
  • Loading branch information
SchSeba committed Jul 12, 2023
1 parent 680654f commit aa401d8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions pkg/plugins/generic/generic_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,20 @@ func needDrainNode(desired sriovnetworkv1.Interfaces, current sriovnetworkv1.Int
for _, ifaceStatus := range current {
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 utils.NeedUpdate(&iface, &ifaceStatus) {
glog.V(2).Infof("generic-plugin needDrainNode(): need drain, PF %s request update", iface.PciAddress)
needDrain = true
return
if ifaceStatus.NumVfs != 0 {
if iface.PciAddress == ifaceStatus.PciAddress {
configured = true
if utils.NeedUpdate(&iface, &ifaceStatus) {
glog.V(2).Infof("generic-plugin needDrainNode(): need drain, PF %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, expect NumVfs %v, current NumVfs %v", iface.NumVfs, ifaceStatus.NumVfs)
} else {
glog.V(2).Infof("generic-plugin needDrainNode(): no need drain, current NumVfs is 0")
}

}
if !configured && ifaceStatus.NumVfs > 0 {
glog.V(2).Infof("generic-plugin needDrainNode(): need drain, %v needs to be reset", ifaceStatus)
Expand Down

0 comments on commit aa401d8

Please sign in to comment.