From e1ad642da0030b38b4e3e9640d3db2fa13e36a6c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 10 Aug 2016 17:23:54 -0400 Subject: [PATCH] Fix intermittent failures in TestPidOf {procfs} Bailout if WalkFunc is called with an error. Fixes #30377 --- pkg/util/procfs/procfs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/util/procfs/procfs.go b/pkg/util/procfs/procfs.go index 72d9abbe01..94a751562d 100644 --- a/pkg/util/procfs/procfs.go +++ b/pkg/util/procfs/procfs.go @@ -65,6 +65,9 @@ func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) { func PidOf(name string) []int { pids := []int{} filepath.Walk("/proc", func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } base := filepath.Base(path) // Traverse only the directories we are interested in if info.IsDir() && path != "/proc" {