From 637479139d07b4c3985cc53c6edd4b54224421b4 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Mon, 9 Dec 2024 17:39:45 +0200 Subject: [PATCH] cgroupstats: golangci-lint fixes. Signed-off-by: Krisztian Litkey --- pkg/cgroupstats/collector.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cgroupstats/collector.go b/pkg/cgroupstats/collector.go index b0db8c72a..ec89287b2 100644 --- a/pkg/cgroupstats/collector.go +++ b/pkg/cgroupstats/collector.go @@ -282,7 +282,7 @@ func walkCgroups() []string { containerDirs := []string{} cpuset := filepath.Join(cgroupRoot, "cpuset") - filepath.Walk(filepath.Join(cpuset, kubepodsDir), + err := filepath.Walk(filepath.Join(cpuset, kubepodsDir), func(path string, info os.FileInfo, err error) error { if err != nil { if os.IsNotExist(err) { @@ -315,6 +315,9 @@ func walkCgroups() []string { return nil }) + if err != nil { + log.Warnf("cgroupfs walk failed: %v", err) + } return containerDirs }