@@ -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-
952948func 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