diff --git a/cmd/kubeadm/app/cmd/reset_test.go b/cmd/kubeadm/app/cmd/reset_test.go index d883fb4a168..d317ad72274 100644 --- a/cmd/kubeadm/app/cmd/reset_test.go +++ b/cmd/kubeadm/app/cmd/reset_test.go @@ -248,12 +248,10 @@ func TestRemoveContainers(t *testing.T) { fcmd := fakeexec.FakeCmd{ CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ func() ([]byte, error) { return []byte("id1\nid2"), nil }, - }, - RunScript: []fakeexec.FakeRunAction{ - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, - func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, error) { return []byte(""), nil }, + func() ([]byte, error) { return []byte(""), nil }, + func() ([]byte, error) { return []byte(""), nil }, + func() ([]byte, error) { return []byte(""), nil }, }, } fexec := fakeexec.FakeExec{ diff --git a/cmd/kubeadm/app/util/runtime/runtime.go b/cmd/kubeadm/app/util/runtime/runtime.go index 1526895216e..4bf165bbb7e 100644 --- a/cmd/kubeadm/app/util/runtime/runtime.go +++ b/cmd/kubeadm/app/util/runtime/runtime.go @@ -108,9 +108,7 @@ func (runtime *CRIRuntime) ListKubeContainers() ([]string, error) { } pods := []string{} for _, pod := range strings.Fields(string(out)) { - if strings.HasPrefix(pod, "k8s_") { - pods = append(pods, pod) - } + pods = append(pods, pod) } return pods, nil } diff --git a/cmd/kubeadm/app/util/runtime/runtime_test.go b/cmd/kubeadm/app/util/runtime/runtime_test.go index d4702d11203..b5f8c1d0560 100644 --- a/cmd/kubeadm/app/util/runtime/runtime_test.go +++ b/cmd/kubeadm/app/util/runtime/runtime_test.go @@ -128,7 +128,7 @@ func TestIsRunning(t *testing.T) { func TestListKubeContainers(t *testing.T) { fcmd := fakeexec.FakeCmd{ CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2\nid3"), nil }, + func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2"), nil }, func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2"), nil }, },