Make sure nodes to launch VMI are schedulable on any infra setup
@@ -590,9 +590,8 @@ var _ = Describe("[rfe_id:273][crit:high][vendor:cnv-qe@redhat.com][level:compon
var nodes *k8sv1.NodeList
var err error
BeforeEach(func() {
- nodes, err = virtClient.CoreV1().Nodes().List(metav1.ListOptions{})
- Expect(err).ToNot(HaveOccurred(), "Should list nodes")
- Expect(nodes.Items).NotTo(BeEmpty(), "There should be some node")
+ nodes = tests.GetAllSchedulableNodes(virtClient)
+ Expect(nodes.Items).ToNot(BeEmpty(), "There should be some compute node")
// Taint first node with "NoSchedule"
data := []byte(`{"spec":{"taints":[{"effect":"NoSchedule","key":"test","timeAdded":null,"value":"123"}]}}`)
@@ -639,9 +638,8 @@ var _ = Describe("[rfe_id:273][crit:high][vendor:cnv-qe@redhat.com][level:compon
var err error
BeforeEach(func() {
- nodes, err = virtClient.CoreV1().Nodes().List(metav1.ListOptions{})
- Expect(err).ToNot(HaveOccurred(), "Should list nodes")
- Expect(nodes.Items).NotTo(BeEmpty(), "There should be some node")
+ nodes = tests.GetAllSchedulableNodes(virtClient)
+ Expect(nodes.Items).ToNot(BeEmpty(), "There should be some compute node")
})
It("[test_id:1637]the vmi with node affinity and no conflicts should be scheduled", func() {
@@ -793,9 +791,8 @@ var _ = Describe("[rfe_id:273][crit:high][vendor:cnv-qe@redhat.com][level:compon
var originalFeatureGates string
BeforeEach(func() {
- nodes, err := virtClient.CoreV1().Nodes().List(metav1.ListOptions{})
- Expect(err).ToNot(HaveOccurred(), "Should list nodes")
- Expect(nodes.Items).ToNot(BeEmpty(), "There should be some nodes")
+ nodes := tests.GetAllSchedulableNodes(virtClient)
+ Expect(nodes.Items).ToNot(BeEmpty(), "There should be some compute node")
node = &nodes.Items[0]
originalLabels = node.GetObjectMeta().GetLabels()
