Commit 25436cdc authored by Ed Bartosh's avatar Ed Bartosh

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.
parent 880dbd33
......@@ -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) == "" {
......
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