1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-16 21:38:23 +00:00

Merge pull request #1856 from ozhuraki/bonding-masters

source/network: Ignore bonding_masters interface during scanning
This commit is contained in:
Kubernetes Prow Robot 2024-09-18 19:16:44 +01:00 committed by GitHub
commit 353ad403d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"slices"
"strconv" "strconv"
"strings" "strings"
"syscall" "syscall"
@ -129,6 +130,10 @@ func detectNetDevices() ([]nfdv1alpha1.InstanceFeature, []nfdv1alpha1.InstanceFe
return nil, nil, fmt.Errorf("failed to list network interfaces: %w", err) return nil, nil, fmt.Errorf("failed to list network interfaces: %w", err)
} }
ifaces = slices.DeleteFunc(ifaces, func(iface os.DirEntry) bool {
return iface.Name() == "bonding_masters"
})
// Iterate over devices // Iterate over devices
devIfacesinfo := make([]nfdv1alpha1.InstanceFeature, 0, len(ifaces)) devIfacesinfo := make([]nfdv1alpha1.InstanceFeature, 0, len(ifaces))
virtualIfacesinfo := make([]nfdv1alpha1.InstanceFeature, 0, len(ifaces)) virtualIfacesinfo := make([]nfdv1alpha1.InstanceFeature, 0, len(ifaces))