Skip to content

Commit

Permalink
update the vfToSkip
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Sch <sebassch@gmail.com>
  • Loading branch information
SchSeba committed Sep 29, 2022
1 parent 7e64a88 commit dd7cb7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions pkg/plugins/generic/generic_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ func (p *GenericPlugin) Apply() error {
for _, ifaceStatus := range p.DesireState.Status.Interfaces {
for _, iface := range p.DesireState.Spec.Interfaces {
if iface.PciAddress == ifaceStatus.PciAddress {
skip, err := utils.SkipConfigVf(iface, ifaceStatus)
if err != nil {
glog.Errorf("generic-plugin Apply(): fail to check for skip VFs %s: %v.", iface.PciAddress, err)
return err
}
skip := utils.SkipConfigVf(iface, ifaceStatus)
vfsToSkip[iface.PciAddress] = skip
break
}
Expand All @@ -120,7 +116,7 @@ func (p *GenericPlugin) Apply() error {
defer exit()
}

if err := utils.SyncNodeState(p.DesireState); err != nil {
if err := utils.SyncNodeState(p.DesireState, vfsToSkip); err != nil {
return err
}
p.LastState = &sriovnetworkv1.SriovNetworkNodeState{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func DiscoverSriovDevices(withUnsupported bool) ([]sriovnetworkv1.InterfaceExt,

// SyncNodeState Attempt to update the node state to match the desired state
//
func SyncNodeState(newState *sriovnetworkv1.SriovNetworkNodeState) error {
func SyncNodeState(newState *sriovnetworkv1.SriovNetworkNodeState, vfsToConfig map[string]bool) error {
return ConfigSriovInterfaces(newState.Spec.Interfaces, newState.Status.Interfaces, vfsToConfig)
}

Expand Down

0 comments on commit dd7cb7d

Please sign in to comment.