Merge pull request #101211 from aojea/nosnat

e2e create pods only on schedulable nodes
This commit is contained in:
Kubernetes Prow Robot
2021-04-17 10:32:34 -07:00
committed by GitHub

View File

@@ -28,6 +28,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/test/e2e/framework"
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
"k8s.io/kubernetes/test/e2e/network/common"
imageutils "k8s.io/kubernetes/test/utils/image"
@@ -65,10 +66,9 @@ var _ = common.SIGDescribe("NoSNAT [Feature:NoSNAT] [Slow]", func() {
ginkgo.It("Should be able to send traffic between Pods without SNAT", func() {
cs := f.ClientSet
pc := cs.CoreV1().Pods(f.Namespace.Name)
nc := cs.CoreV1().Nodes()
ginkgo.By("creating a test pod on each Node")
nodes, err := nc.List(context.TODO(), metav1.ListOptions{})
nodes, err := e2enode.GetReadySchedulableNodes(cs)
framework.ExpectNoError(err)
framework.ExpectNotEqual(len(nodes.Items), 0, "no Nodes in the cluster")