Infra test made invalid assumptions about cluster composition
@@ -299,7 +299,11 @@ var _ = Describe("[Serial]Infrastructure", func() {
// tolerate this taint because it is meant to be used on compute nodes only. If we set this taint
// on a master node, we risk in breaking the test cluster.
for _, pod := range pods.Items {
- node := schedulableNodes[pod.Spec.NodeName]
+ node, ok := schedulableNodes[pod.Spec.NodeName]
+ if !ok {
+ // Pod is running on a non-schedulable node?
+ continue
+ }
if _, isMaster := node.Labels["node-role.kubernetes.io/master"]; isMaster {
continue
}
@@ -307,6 +311,12 @@ var _ = Describe("[Serial]Infrastructure", func() {
break
}
+ // It is possible to run this test on a cluster that simply does not have worker nodes.
+ // Since KubeVirt can't control that, the only correct action is to halt the test.
+ if selectedNodeName == "" {
+ Skip("Could nould determine a node to safely taint")
+ }
+
By("setting up a watch for terminated pods")
lw, err := virtClient.CoreV1().Pods(flags.KubeVirtInstallNamespace).Watch(metav1.ListOptions{})
Expect(err).ToNot(HaveOccurred())
