Skip to content

Commit cc29d49

Browse files
authored
🐛 Fix upgrade runtimesdk test (#12833)
* fix upgrade runtimesdk test * fix lint
1 parent 3e31856 commit cc29d49

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/e2e/cluster_upgrade_runtimesdk.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ func ClusterUpgradeWithRuntimeSDKSpec(ctx context.Context, inputGetter func() Cl
301301
controlPlaneVersion := fromVersion
302302
workersVersion := fromVersion
303303

304-
checkControlPlaneVersion(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster, controlPlaneVersion)
305-
checkWorkersVersions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster, workersVersion)
304+
// wait for all Machines to exist before starting the upgrade.
305+
waitControlPlaneVersion(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster, controlPlaneVersion, input.E2EConfig.GetIntervals(specName, "wait-control-plane-upgrade"))
306+
waitWorkersVersions(ctx, input.BootstrapClusterProxy.GetClient(), clusterResources.Cluster, workersVersion, input.E2EConfig.GetIntervals(specName, "wait-machine-upgrade"))
306307

307308
// Add a BeforeClusterUpgrade hook annotation to block via the annotation.
308309
beforeClusterUpgradeAnnotation := clusterv1.BeforeClusterUpgradeHookAnnotationPrefix + "/upgrade-test"
@@ -944,11 +945,6 @@ func waitControlPlaneVersion(ctx context.Context, c client.Client, cluster *clus
944945
controlPlaneVersion(ctx, c, cluster, version, intervals...)
945946
}
946947

947-
func checkControlPlaneVersion(ctx context.Context, c client.Client, cluster *clusterv1.Cluster, version string) {
948-
Byf("Checking control plane has version %s", version)
949-
controlPlaneVersion(ctx, c, cluster, version, "10s", "2s")
950-
}
951-
952948
func controlPlaneVersion(ctx context.Context, c client.Client, cluster *clusterv1.Cluster, version string, intervals ...interface{}) {
953949
Eventually(func(_ Gomega) bool {
954950
controlPlane, err := external.GetObjectFromContractVersionedRef(ctx, c, cluster.Spec.ControlPlaneRef, cluster.Namespace)

0 commit comments

Comments
 (0)