mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #93551 from brianpursley/runtimeclass-e2e-fix
Remove special case for node e2e tests when expecting pod rejection
This commit is contained in:
commit
20fbf09c3e
@ -97,16 +97,9 @@ func createRuntimeClass(f *framework.Framework, name, handler string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func expectPodRejection(f *framework.Framework, pod *v1.Pod) {
|
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{})
|
_, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(context.TODO(), pod, metav1.CreateOptions{})
|
||||||
framework.ExpectError(err, "should be forbidden")
|
framework.ExpectError(err, "should be forbidden")
|
||||||
framework.ExpectEqual(apierrors.IsForbidden(err), true, "should be forbidden error")
|
framework.ExpectEqual(apierrors.IsForbidden(err), true, "should be forbidden error")
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// expectPodSuccess waits for the given pod to terminate successfully.
|
// expectPodSuccess waits for the given pod to terminate successfully.
|
||||||
|
Loading…
Reference in New Issue
Block a user