Skip to content

Commit

Permalink
generic plugin: reset interface on error
Browse files Browse the repository at this point in the history
If error occures during sriov configuration in
generic plugin, config daemon will log the error
and requeue the request to reconcile the node.

On the next run, when generic plugin Apply() method
is called, interface configuration may be skipped,
leaving the interface partially configured.

To ensure generic plugin re-configures the interface
on the next iteration, we reset the interface
before returning an error.

This will also ensure that a drain will be requested
as well.

Signed-off-by: Adrian Chiris <[email protected]>
  • Loading branch information
adrianchiris committed May 2, 2022
1 parent a40a2a1 commit facabb2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ func SyncNodeState(newState *sriovnetworkv1.SriovNetworkNodeState) error {
break
}
if err = configSriovDevice(&iface, &ifaceStatus); err != nil {
glog.Errorf("SyncNodeState(): fail to config sriov interface %s: %v", iface.PciAddress, err)
glog.Errorf("SyncNodeState(): fail to configure sriov interface %s: %v. resetting interface.", iface.PciAddress, err)
if resetErr := resetSriovDevice(ifaceStatus); resetErr != nil {
glog.Errorf("SyncNodeState(): fail to reset on error SR-IOV interface: %s", resetErr)
}
return err
}
break
Expand Down

0 comments on commit facabb2

Please sign in to comment.