diff --git a/metricbeat/module/system/filesystem/helper.go b/metricbeat/module/system/filesystem/helper.go index e604633dd2d8..29a26b7381cb 100644 --- a/metricbeat/module/system/filesystem/helper.go +++ b/metricbeat/module/system/filesystem/helper.go @@ -36,6 +36,11 @@ func GetFileSystemList() ([]sigar.FileSystem, error) { return nil, err } + if runtime.GOOS == "windows" { + // No filtering on Windows + return fss.List, nil + } + return filterFileSystemList(fss.List), nil } diff --git a/metricbeat/module/system/filesystem/helper_test.go b/metricbeat/module/system/filesystem/helper_test.go index fbc6c424b4fc..9fa6211553c7 100644 --- a/metricbeat/module/system/filesystem/helper_test.go +++ b/metricbeat/module/system/filesystem/helper_test.go @@ -140,34 +140,6 @@ func TestFileSystemListFiltering(t *testing.T) { } } -func TestFileSystemListFilteringWindows(t *testing.T) { - if runtime.GOOS != "windows" { - t.Skip("These cases only need to work on windows") - } - - cases := []struct { - description string - fss, expected []sigar.FileSystem - }{ - { - description: "Keep all filesystems in Windows", - fss: []sigar.FileSystem{ - {DirName: "C:\\", DevName: "C:\\"}, - {DirName: "D:\\", DevName: "D:\\"}, - }, - expected: []sigar.FileSystem{ - {DirName: "C:\\", DevName: "C:\\"}, - {DirName: "D:\\", DevName: "D:\\"}, - }, - }, - } - - for _, c := range cases { - filtered := filterFileSystemList(c.fss) - assert.ElementsMatch(t, c.expected, filtered, c.description) - } -} - func TestFilter(t *testing.T) { in := []sigar.FileSystem{ {SysTypeName: "nfs"},