From 21395cb5c393bd8c5c3b8673260d8822009ade90 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakivskyy Date: Wed, 28 Aug 2024 14:05:45 +0300 Subject: [PATCH] source/network: Ignore bonding_masters interface during scanning On Talos OS NFD logs constantly show errors related to the network attributes of bonding_masters. Closes: 1842 Signed-off-by: Oleg Zhurakivskyy --- source/network/network.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/network/network.go b/source/network/network.go index 5f35d5064..4039b082d 100644 --- a/source/network/network.go +++ b/source/network/network.go @@ -21,6 +21,7 @@ import ( "fmt" "os" "path/filepath" + "slices" "strconv" "strings" "syscall" @@ -129,6 +130,10 @@ func detectNetDevices() ([]nfdv1alpha1.InstanceFeature, []nfdv1alpha1.InstanceFe 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 devIfacesinfo := make([]nfdv1alpha1.InstanceFeature, 0, len(ifaces)) virtualIfacesinfo := make([]nfdv1alpha1.InstanceFeature, 0, len(ifaces))