mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Adding an if statement to check the number of worker nodes available before running a test that needs 2 nodes.
Checking avoids error assertion in function 'CreateHostPortPods' to fail.
This commit is contained in:
parent
c5dc18b593
commit
d39453c35e
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user