tests: Enables a few Conformance tests for Windows

Some of these tests could not be run previously, especially on Windows
Docker containers. But now, by using Windows Containerd, we can finally
run them:

- HostNetwork=true tests: This can now be enabled on Windows Privileged Containers.
- /etc/hosts related tests: These were not supported because it required single
  file mappings, which is possible in Containerd.
- termination message as non-root user: Requires RunAsUsername, and single file
  mappings.
This commit is contained in:
Claudiu Belu
2021-11-17 02:25:35 -08:00
parent c964ef8d8a
commit 87123c49a0
7 changed files with 55 additions and 33 deletions

View File

@@ -848,6 +848,11 @@ func (config *NetworkingTestConfig) createNetProxyPods(podName string, selector
pod := config.createNetShellPodSpec(podName, hostname)
pod.ObjectMeta.Labels = selector
pod.Spec.HostNetwork = config.EndpointsHostNetwork
// NOTE(claudiub): In order to use HostNetwork on Windows, we need to use Privileged Containers.
if pod.Spec.HostNetwork && framework.NodeOSDistroIs("windows") {
e2epod.WithWindowsHostProcess(pod, "")
}
createdPod := config.createPod(pod)
createdPods = append(createdPods, createdPod)
}