Skip to content

Commit 23a5e6e

Browse files
committed
Improve check for Cluster Available condition in e2e tests
Signed-off-by: Stefan Büringer [email protected]
1 parent bfb09ac commit 23a5e6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/framework/cluster_helpers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,16 @@ func VerifyClusterAvailable(ctx context.Context, input VerifyClusterAvailableInp
450450
// Wait for the cluster Available condition to stabilize.
451451
Eventually(func(g Gomega) {
452452
g.Expect(input.Getter.Get(ctx, key, cluster)).To(Succeed())
453+
availableConditionFound := false
453454
for _, condition := range cluster.Status.Conditions {
454455
if condition.Type == clusterv1.AvailableCondition {
456+
availableConditionFound = true
455457
g.Expect(condition.Status).To(Equal(metav1.ConditionTrue), "The Available condition on the Cluster should be set to true; message: %s", condition.Message)
456458
g.Expect(condition.Message).To(BeEmpty(), "The Available condition on the Cluster should have an empty message")
457-
return
459+
break
458460
}
459461
}
462+
g.Expect(availableConditionFound).To(BeTrue(), "Cluster %q should have an Available condition", input.Name)
460463
}, 5*time.Minute, 10*time.Second).Should(Succeed(), "Failed to verify Cluster Available condition for %s", klog.KRef(input.Namespace, input.Name))
461464
}
462465

0 commit comments

Comments
 (0)