diff --git a/test/e2e/windows/service.go b/test/e2e/windows/service.go index 0716fa37075..b3e650bba20 100644 --- a/test/e2e/windows/service.go +++ b/test/e2e/windows/service.go @@ -56,16 +56,26 @@ var _ = SIGDescribe("Services", func() { nodePort := int(svc.Spec.Ports[0].NodePort) ginkgo.By("creating Pod to be part of service " + serviceName) - _, err = jig.Run(nil) + // tweak the Jig to use windows... + windowsNodeSelectorTweak := func(rc *v1.ReplicationController) { + rc.Spec.Template.Spec.NodeSelector = map[string]string{ + "kubernetes.io/os": "windows", + } + } + _, err = jig.Run(windowsNodeSelectorTweak) framework.ExpectNoError(err) //using hybrid_network methods ginkgo.By("creating Windows testing Pod") - windowsPod := createTestPod(f, windowsBusyBoximage, windowsOS) - windowsPod = f.PodClient().CreateSync(windowsPod) + testPod := createTestPod(f, windowsBusyBoximage, windowsOS) + testPod = f.PodClient().CreateSync(testPod) + + ginkgo.By("verifying that pod has the correct nodeSelector") + // Admission controllers may sometimes do the wrong thing + framework.ExpectEqual(testPod.Spec.NodeSelector["kubernetes.io/os"], "windows") ginkgo.By(fmt.Sprintf("checking connectivity Pod to curl http://%s:%d", nodeIP, nodePort)) - assertConsistentConnectivity(f, windowsPod.ObjectMeta.Name, windowsOS, windowsCheck(fmt.Sprintf("http://%s:%d", nodeIP, nodePort))) + assertConsistentConnectivity(f, testPod.ObjectMeta.Name, windowsOS, windowsCheck(fmt.Sprintf("http://%s:%d", nodeIP, nodePort))) })