mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #97809 from jayunit100/fix_node_port_windows
Fix node port tests windows nodeSelector metadata
This commit is contained in:
commit
04e3106b1e
@ -56,16 +56,26 @@ var _ = SIGDescribe("Services", func() {
|
|||||||
nodePort := int(svc.Spec.Ports[0].NodePort)
|
nodePort := int(svc.Spec.Ports[0].NodePort)
|
||||||
|
|
||||||
ginkgo.By("creating Pod to be part of service " + serviceName)
|
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)
|
framework.ExpectNoError(err)
|
||||||
|
|
||||||
//using hybrid_network methods
|
//using hybrid_network methods
|
||||||
ginkgo.By("creating Windows testing Pod")
|
ginkgo.By("creating Windows testing Pod")
|
||||||
windowsPod := createTestPod(f, windowsBusyBoximage, windowsOS)
|
testPod := createTestPod(f, windowsBusyBoximage, windowsOS)
|
||||||
windowsPod = f.PodClient().CreateSync(windowsPod)
|
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))
|
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)))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user