1
0
Fork 0
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:
mantramantra12 2024-01-23 21:20:43 +00:00 committed by GitHub
parent c677736e4c
commit ea4504a916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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