TestCreatePodSandbox_RuntimeClass should not expect RunPodSandbox when runtime class is not found

pull/564/head
Seth Jennings 2019-01-31 12:54:21 -06:00
parent adc95eb214
commit 6b51d48c4f
1 changed files with 2 additions and 2 deletions

View File

@ -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")