Skip to content

Commit

Permalink
add nerdctl to ignoredDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
Rouzip authored and dims committed Mar 19, 2023
1 parent 648b12f commit 2062bf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utils/sysinfo/sysinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func GetNetworkDevices(sysfs sysfs.SysFs) ([]info.NetInfo, error) {
for _, dev := range devs {
name := dev.Name()
// Ignore docker, loopback, and veth devices.
ignoredDevices := []string{"lo", "veth", "docker"}
ignoredDevices := []string{"lo", "veth", "docker", "nerdctl"}
ignored := false
for _, prefix := range ignoredDevices {
if strings.HasPrefix(name, prefix) {
Expand Down
2 changes: 1 addition & 1 deletion utils/sysinfo/sysinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ func TestGetNetworkDevices(t *testing.T) {

func TestIgnoredNetworkDevices(t *testing.T) {
fakeSys := fakesysfs.FakeSysFs{}
ignoredDevices := []string{"veth1234", "lo", "docker0"}
ignoredDevices := []string{"veth1234", "lo", "docker0", "nerdctl0"}
for _, name := range ignoredDevices {
fakeSys.SetEntryName(name)
devs, err := GetNetworkDevices(&fakeSys)
Expand Down

0 comments on commit 2062bf5

Please sign in to comment.