mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +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
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue