From 6b51d48c4f8c293838b8cb53c0369ee1ee852715 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Thu, 31 Jan 2019 12:54:21 -0600 Subject: [PATCH] TestCreatePodSandbox_RuntimeClass should not expect RunPodSandbox when runtime class is not found --- pkg/kubelet/kuberuntime/kuberuntime_sandbox_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kuberuntime/kuberuntime_sandbox_test.go b/pkg/kubelet/kuberuntime/kuberuntime_sandbox_test.go index 6d23710e8b9..e2719229fde 100644 --- a/pkg/kubelet/kuberuntime/kuberuntime_sandbox_test.go +++ b/pkg/kubelet/kuberuntime/kuberuntime_sandbox_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" utilfeaturetesting "k8s.io/apiserver/pkg/util/feature/testing" @@ -79,13 +79,13 @@ func TestCreatePodSandbox_RuntimeClass(t *testing.T) { } for name, test := range tests { t.Run(name, func(t *testing.T) { + fakeRuntime.Called = []string{} pod := newTestPod() pod.Spec.RuntimeClassName = test.rcn id, _, err := m.createPodSandbox(pod, 1) if test.expectError { assert.Error(t, err) - assert.Contains(t, fakeRuntime.Called, "RunPodSandbox") } else { assert.NoError(t, err) assert.Contains(t, fakeRuntime.Called, "RunPodSandbox")