diff --git a/test/e2e/windows/host_process.go b/test/e2e/windows/host_process.go index c16a5f5a16b..07278fb2a78 100644 --- a/test/e2e/windows/host_process.go +++ b/test/e2e/windows/host_process.go @@ -521,6 +521,8 @@ var _ = SIGDescribe("[Feature:WindowsHostProcessContainers] [MinimumKubeletVersi ginkgo.By("Scheduling a pod with a HostProcess init container that will fail") + badUserName := "bad-user-name" + podName := "host-process-metrics-pod-failing-init-container" pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ @@ -536,6 +538,11 @@ var _ = SIGDescribe("[Feature:WindowsHostProcessContainers] [MinimumKubeletVersi HostNetwork: true, InitContainers: []v1.Container{ { + SecurityContext: &v1.SecurityContext{ + WindowsOptions: &v1.WindowsSecurityContextOptions{ + RunAsUserName: &badUserName, + }, + }, Image: imageutils.GetE2EImage(imageutils.BusyBox), Name: "failing-init-container", Command: []string{"foobar.exe"}, @@ -572,6 +579,11 @@ var _ = SIGDescribe("[Feature:WindowsHostProcessContainers] [MinimumKubeletVersi HostNetwork: true, Containers: []v1.Container{ { + SecurityContext: &v1.SecurityContext{ + WindowsOptions: &v1.WindowsSecurityContextOptions{ + RunAsUserName: &badUserName, + }, + }, Image: imageutils.GetE2EImage(imageutils.BusyBox), Name: "failing-container", Command: []string{"foobar.exe"},