From 6029346d0dca23b2c847d4d687ba5dad82800755 Mon Sep 17 00:00:00 2001 From: Brian Pursley Date: Wed, 29 Jul 2020 22:28:03 -0400 Subject: [PATCH] Remove special case for node e2e tests when expecting pod rejection --- test/e2e/common/runtimeclass.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/test/e2e/common/runtimeclass.go b/test/e2e/common/runtimeclass.go index 6b7b5b4776f..9a0970a68ac 100644 --- a/test/e2e/common/runtimeclass.go +++ b/test/e2e/common/runtimeclass.go @@ -97,16 +97,9 @@ func createRuntimeClass(f *framework.Framework, name, handler string) string { } func expectPodRejection(f *framework.Framework, pod *v1.Pod) { - // The Node E2E doesn't run the RuntimeClass admission controller, so we expect the rejection to - // happen by the Kubelet. - if framework.TestContext.NodeE2E { - pod = f.PodClient().Create(pod) - expectSandboxFailureEvent(f, pod, fmt.Sprintf("\"%s\" not found", *pod.Spec.RuntimeClassName)) - } else { - _, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(context.TODO(), pod, metav1.CreateOptions{}) - framework.ExpectError(err, "should be forbidden") - framework.ExpectEqual(apierrors.IsForbidden(err), true, "should be forbidden error") - } + _, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(context.TODO(), pod, metav1.CreateOptions{}) + framework.ExpectError(err, "should be forbidden") + framework.ExpectEqual(apierrors.IsForbidden(err), true, "should be forbidden error") } // expectPodSuccess waits for the given pod to terminate successfully.