Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix node port tests windows nodeSelector metadata #97809

Merged
merged 1 commit into from Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 14 additions & 4 deletions test/e2e/windows/service.go
Expand Up @@ -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)
jayunit100 marked this conversation as resolved.
Show resolved Hide resolved
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)))

})

Expand Down