mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Fix intermittent failures in TestPidOf {procfs}
Bailout if WalkFunc is called with an error. Fixes #30377
This commit is contained in:
parent
eef8bfec23
commit
e1ad642da0
@ -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" {
|
||||
|
Loading…
Reference in New Issue
Block a user