Skip to content

Commit

Permalink
Merge pull request #490 from e0ne/node-policy-net-filter
Browse files Browse the repository at this point in the history
Return reconcile error if node state is not updated
  • Loading branch information
adrianchiris committed Aug 21, 2023
2 parents db75a90 + fd0737a commit ce73a4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controllers/sriovnetworknodepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ func createDevicePluginResource(
// Enable the selection of devices using NetFilter
if p.Spec.NicSelector.NetFilter != "" {
// Loop through interfaces status to find a match for NetworkID or NetworkTag
if len(nodeState.Status.Interfaces) == 0 {
return nil, fmt.Errorf("node state %s doesn't contain interfaces data", nodeState.Name)
}
for _, intf := range nodeState.Status.Interfaces {
if sriovnetworkv1.NetFilterMatch(p.Spec.NicSelector.NetFilter, intf.NetFilter) {
// Found a match add the Interfaces PciAddress
Expand Down

0 comments on commit ce73a4d

Please sign in to comment.