Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions test/e2e/control_plane_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ func TestUpgradeControlPlane(t *testing.T) {
// Sanity check the cluster by waiting for the nodes to report ready
guestClient := e2eutil.WaitForGuestClient(t, ctx, mgtClient, hostedCluster)

var startingVersion string
if len(hostedCluster.Status.Version.History) > 0 {
startingVersion = hostedCluster.Status.Version.History[0].Version
}

// Set the semantic version to the latest release image for version gating tests
err := e2eutil.SetReleaseImageVersion(testContext, globalOpts.LatestReleaseImage, globalOpts.ConfigurableClusterOptions.PullSecretFile)
if err != nil {
Expand All @@ -59,11 +54,6 @@ func TestUpgradeControlPlane(t *testing.T) {
})
g.Expect(err).NotTo(HaveOccurred(), "failed update hostedcluster image")

t.Run("Wait for control plane components to complete rollout", func(t *testing.T) {
e2eutil.AtLeast(t, e2eutil.Version420)
e2eutil.WaitForControlPlaneComponentRollout(t, ctx, mgtClient, hostedCluster, startingVersion)
})

// Wait for the new rollout to be complete
e2eutil.WaitForImageRollout(t, ctx, mgtClient, hostedCluster)
err = mgtClient.Get(ctx, crclient.ObjectKeyFromObject(hostedCluster), hostedCluster)
Expand Down
9 changes: 9 additions & 0 deletions test/e2e/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,15 @@ func WaitForNReadyNodesWithOptions(t *testing.T, ctx context.Context, client crc
}

func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
var startingVersion string
if len(hostedCluster.Status.Version.History) > 0 {
startingVersion = hostedCluster.Status.Version.History[0].Version
}
t.Run("Wait for control plane components to complete rollout", func(t *testing.T) {
AtLeast(t, Version420)
WaitForControlPlaneComponentRollout(t, ctx, client, hostedCluster, startingVersion)
})

var lastVersionCompletionTime *metav1.Time
if hostedCluster.Status.Version != nil &&
len(hostedCluster.Status.Version.History) > 0 {
Expand Down