Commit 5992deda authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #30478 from dims/fix-test-pidof-take-2

Automatic merge from submit-queue Fix TestPidOf {procfs} - Take #2 We should not bailout when we get an error. We should continue processing other files/directories. We were returning the err passed in which was causing the processing to stop. Fixes #30377
parents d933f078 24e8e12b
...@@ -66,7 +66,8 @@ func PidOf(name string) []int { ...@@ -66,7 +66,8 @@ func PidOf(name string) []int {
pids := []int{} pids := []int{}
filepath.Walk("/proc", func(path string, info os.FileInfo, err error) error { filepath.Walk("/proc", func(path string, info os.FileInfo, err error) error {
if err != nil { if err != nil {
return err // We should continue processing other directories/files
return nil
} }
base := filepath.Base(path) base := filepath.Base(path)
// Traverse only the directories we are interested in // Traverse only the directories we are interested in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment