diff --git a/test/e2e/util/util.go b/test/e2e/util/util.go index d7a9b41eb7..b2e5523b19 100644 --- a/test/e2e/util/util.go +++ b/test/e2e/util/util.go @@ -390,12 +390,12 @@ func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Clie Status: metav1.ConditionFalse, }), func(hostedCluster *hyperv1.HostedCluster) (done bool, reasons string, err error) { + if wanted, got := image, ptr.Deref(hostedCluster.Status.Version, hyperv1.ClusterVersionStatus{}).Desired.Image; wanted != got { + return false, fmt.Sprintf("wanted HostedCluster to desire image %s, got %s", wanted, got), nil + } if len(ptr.Deref(hostedCluster.Status.Version, hyperv1.ClusterVersionStatus{}).History) == 0 { return false, "HostedCluster has no version history", nil } - if wanted, got := hostedCluster.Status.Version.History[0].Version, ptr.Deref(hostedCluster.Status.Version, hyperv1.ClusterVersionStatus{}).Desired.Version; wanted != got { - return false, fmt.Sprintf("wanted HostedCluster to desired version %s, got %s", wanted, got), nil - } if wanted, got := hostedCluster.Status.Version.Desired.Image, hostedCluster.Status.Version.History[0].Image; wanted != got { return false, fmt.Sprintf("desired image %s doesn't match most recent image in history %s", wanted, got), nil }