Merge pull request #79392 from Bowenislandsong/master

adding pre-condition for an e2e scheduler test
This commit is contained in:
Kubernetes Prow Robot 2019-06-28 12:43:44 -07:00 committed by GitHub
commit 8e55b5dd40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,6 +172,10 @@ var _ = framework.KubeDescribe("EquivalenceCache [Serial]", func() {
// This test verifies that MatchInterPodAffinity (anti-affinity) is respected as expected.
ginkgo.It("validates pod anti-affinity works properly when new replica pod is scheduled", func() {
// check if there are at least 2 worker nodes available, else skip this test.
if len(nodeList.Items) < 2 {
framework.Skipf("Skipping as the test requires at least two worker nodes, current number of nodes: %d", len(nodeList.Items))
}
ginkgo.By("Launching two pods on two distinct nodes to get two node names")
CreateHostPortPods(f, "host-port", 2, true)
defer framework.DeleteRCAndWaitForGC(f.ClientSet, ns, "host-port")