mirror of https://github.com/k3s-io/k3s
Merge pull request #63862 from runcom/fix-reset-crictl
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). 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>. kubeadm: crictl reset commands fixes Signed-off-by: Antonio Murdaca <runcom@redhat.com> **What this PR does / why we need it**: change container stop/rm commands with sandbox stop/rm to properly reset using kubeadm **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes https://github.com/kubernetes/kubeadm/issues/748 **Special notes for your reviewer**: **Release note**: ```release-note Correct the way we reset containers and pods in kubeadm via crictl ```pull/8/head
commit
42d65671eb
|
@ -221,14 +221,14 @@ func resetWithCrictl(execer utilsexec.Interface, dockerCheck preflight.Checker,
|
|||
if strings.TrimSpace(s) == "" {
|
||||
continue
|
||||
}
|
||||
params = []string{"-r", criSocketPath, "stop", s}
|
||||
params = []string{"-r", criSocketPath, "stopp", s}
|
||||
glog.V(1).Infof("[reset] Executing command %s %s", crictlPath, strings.Join(params, " "))
|
||||
if err := execer.Command(crictlPath, params...).Run(); err != nil {
|
||||
glog.Infof("[reset] failed to stop the running containers using crictl: %v. Trying to use docker instead", err)
|
||||
resetWithDocker(execer, dockerCheck)
|
||||
return
|
||||
}
|
||||
params = []string{"-r", criSocketPath, "rm", s}
|
||||
params = []string{"-r", criSocketPath, "rmp", s}
|
||||
glog.V(1).Infof("[reset] Executing command %s %s", crictlPath, strings.Join(params, " "))
|
||||
if err := execer.Command(crictlPath, params...).Run(); err != nil {
|
||||
glog.Infof("[reset] failed to remove the running containers using crictl: %v. Trying to use docker instead", err)
|
||||
|
|
Loading…
Reference in New Issue