mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #30402 from dims/fix-issue-30377
Automatic merge from submit-queue Fix intermittent failures in TestPidOf {procfs} Bailout if WalkFunc is called with an error. Fixes #30377 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30402) <!-- Reviewable:end -->
This commit is contained in:
commit
342aac2ffd
@ -65,6 +65,9 @@ func (pfs *ProcFS) GetFullContainerName(pid int) (string, error) {
|
|||||||
func PidOf(name string) []int {
|
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 {
|
||||||
|
return err
|
||||||
|
}
|
||||||
base := filepath.Base(path)
|
base := filepath.Base(path)
|
||||||
// Traverse only the directories we are interested in
|
// Traverse only the directories we are interested in
|
||||||
if info.IsDir() && path != "/proc" {
|
if info.IsDir() && path != "/proc" {
|
||||||
|
Loading…
Reference in New Issue
Block a user