@@ -241,6 +241,14 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
241
241
return selfHostedClusterProxy .GetClient ().Get (ctx , client.ObjectKey {Name : "kube-system" }, kubeSystem )
242
242
}, "5s" , "100ms" ).Should (Succeed (), "Failed to assert self-hosted API server stability" )
243
243
244
+ By ("Ensure all machines have NodeRef before doing move" )
245
+ // Ensure all machines have NodeRef before attempting to move.
246
+ // This prevents clusterctl move failures when machines are still provisioning.
247
+ framework .WaitForClusterMachineNodeRefs (ctx , framework.WaitForClusterMachineNodeRefsInput {
248
+ GetLister : input .BootstrapClusterProxy .GetClient (),
249
+ Cluster : cluster ,
250
+ }, input .E2EConfig .GetIntervals (specName , "wait-machine-upgrade" )... )
251
+
244
252
// Get the machines of the workloadCluster before it is moved to become self-hosted to make sure that the move did not trigger
245
253
// any unexpected rollouts.
246
254
preMoveMachineList := & unstructured.UnstructuredList {}
@@ -443,6 +451,14 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
443
451
return selfHostedClusterProxy .GetClient ().Get (ctx , client.ObjectKey {Name : "kube-system" }, kubeSystem )
444
452
}, "5s" , "100ms" ).Should (Succeed (), "Failed to assert self-hosted API server stability" )
445
453
454
+ By ("Ensure all machines have NodeRef before doing move back" )
455
+ // Ensure all machines have NodeRef before attempting to move back to bootstrap.
456
+ // This prevents clusterctl move failures when machines are still provisioning.
457
+ framework .WaitForClusterMachineNodeRefs (ctx , framework.WaitForClusterMachineNodeRefsInput {
458
+ GetLister : selfHostedClusterProxy .GetClient (),
459
+ Cluster : selfHostedCluster ,
460
+ }, input .E2EConfig .GetIntervals (specName , "wait-machine-upgrade" )... )
461
+
446
462
By ("Moving the cluster back to bootstrap" )
447
463
clusterctl .Move (ctx , clusterctl.MoveInput {
448
464
LogFolder : filepath .Join (input .ArtifactFolder , "clusters" , clusterResources .Cluster .Name ),
0 commit comments