mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #64322 from bart0sh/PR0014-fix-parsing-crictl-pods
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix parsing 'crictl pods -q' output **What this PR does / why we need it**: fix parsing 'crictl pods -q' output Output of crictl pods -q is a list of running pod ids, one id per line. Current code splits this output incorrectly which makes next command 'crictl stopp' fail if there is more than one pod running. Should be fixed by using strings.Fields instead of strings.Split. **Release note**: ```release-note NONE ```
This commit is contained in:
commit
1bb6fa848c
@ -215,7 +215,7 @@ func resetWithCrictl(execer utilsexec.Interface, dockerCheck preflight.Checker,
|
||||
resetWithDocker(execer, dockerCheck)
|
||||
return
|
||||
}
|
||||
sandboxes := strings.Split(string(output), " ")
|
||||
sandboxes := strings.Fields(string(output))
|
||||
glog.V(1).Infoln("[reset] Stopping and removing running containers using crictl")
|
||||
for _, s := range sandboxes {
|
||||
if strings.TrimSpace(s) == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user