Skip to content

Commit

Permalink
Prevent nfd-worker erroring when reading attributes from paravirtua…
Browse files Browse the repository at this point in the history
…l devices (kubernetes-sigs#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]>
  • Loading branch information
2 people authored and cruizen committed Mar 12, 2024
1 parent 6f5cc1b commit 9c56fdf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ limitations under the License.
package network

import (
"errors"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"syscall"

"k8s.io/klog/v2"

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

0 comments on commit 9c56fdf

Please sign in to comment.