Skip to content

Commit ea4504a

Browse files
Prevent nfd-worker erroring when reading attributes from paravirtual devices (#1557)
* prevent erroring on paravirtual devices * Use `errors.Is()` for error checking Co-authored-by: Markus Lehtonen <[email protected]> * add imports --------- Co-authored-by: Markus Lehtonen <[email protected]>
1 parent c677736 commit ea4504a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/network/network.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ limitations under the License.
1717
package network
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"os"
2223
"path/filepath"
2324
"strconv"
2425
"strings"
26+
"syscall"
2527

2628
"k8s.io/klog/v2"
2729

@@ -148,7 +150,7 @@ func readIfaceInfo(path string, attrFiles []string) nfdv1alpha1.InstanceFeature
148150
for _, attrFile := range attrFiles {
149151
data, err := os.ReadFile(filepath.Join(path, attrFile))
150152
if err != nil {
151-
if !os.IsNotExist(err) {
153+
if !os.IsNotExist(err) && !errors.Is(err, syscall.EINVAL) {
152154
klog.ErrorS(err, "failed to read net iface attribute", "attributeName", attrFile)
153155
}
154156
continue

0 commit comments

Comments
 (0)