mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-17 05:48:21 +00:00
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 <markus.lehtonen@intel.com> * add imports --------- Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com>
This commit is contained in:
parent
c677736e4c
commit
ea4504a916
1 changed files with 3 additions and 1 deletions
|
@ -17,11 +17,13 @@ limitations under the License.
|
||||||
package network
|
package network
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
|
||||||
|
@ -148,7 +150,7 @@ func readIfaceInfo(path string, attrFiles []string) nfdv1alpha1.InstanceFeature
|
||||||
for _, attrFile := range attrFiles {
|
for _, attrFile := range attrFiles {
|
||||||
data, err := os.ReadFile(filepath.Join(path, attrFile))
|
data, err := os.ReadFile(filepath.Join(path, attrFile))
|
||||||
if err != nil {
|
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)
|
klog.ErrorS(err, "failed to read net iface attribute", "attributeName", attrFile)
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue