Skip to content

Commit 255163d

Browse files
committed
e2e: Add catalog source health check to assertSubscription
By OLM design, a subscription cannot be installed unless all catalog sources are healthy, regardless of which catalog source the subscription uses. This commit updates the `assertSubscription` helper to verify catalog source health as part of its checks.
1 parent 422c9ab commit 255163d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/e2e/util_gatewayapi_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,16 @@ func assertSubscription(t *testing.T, namespace, subName string) error {
574574
return false, nil
575575
}
576576
t.Logf("found subscription %s at installed version %s", subscription.Name, subscription.Status.InstalledCSV)
577+
for _, c := range subscription.Status.Conditions {
578+
if c.Type == operatorsv1alpha1.SubscriptionCatalogSourcesUnhealthy {
579+
if c.Status == corev1.ConditionTrue {
580+
t.Logf("catalog sources unhealthy for subscription %s, retrying...", subName)
581+
return false, nil
582+
}
583+
break
584+
}
585+
}
586+
t.Logf("all catalog sources healthy for subscription %s", subscription.Name)
577587
return true, nil
578588
})
579589
return err

0 commit comments

Comments
 (0)