@@ -226,6 +226,26 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
226
226
Namespace : namespace .Name ,
227
227
})
228
228
229
+ // Note: clusterctl should restore the managedFields to the same as before the move,
230
+ // and thus removing any managedField entries with clusterctl as a manager. This should happen
231
+ // for all the objects processed by move, but for sake of simplicity we test only the Cluster
232
+ // object. The Cluster object has special processing for the paused field during the move to
233
+ // avoid having clusterctl as the manager of the field.
234
+ log .Logf ("Ensure clusterctl does not take ownership on any fields on the self-hosted cluster" )
235
+ selfHostedCluster := framework .GetClusterByName (ctx , framework.GetClusterByNameInput {
236
+ Getter : selfHostedClusterProxy .GetClient (),
237
+ Name : cluster .Name ,
238
+ Namespace : selfHostedNamespace .Name ,
239
+ })
240
+ hasClusterctlManagedFields := false
241
+ for _ , managedField := range selfHostedCluster .GetManagedFields () {
242
+ if managedField .Manager == "clusterctl" {
243
+ hasClusterctlManagedFields = true
244
+ break
245
+ }
246
+ }
247
+ Expect (hasClusterctlManagedFields ).To (BeFalse (), "clusterctl should not manage any fields on the Cluster after the move" )
248
+
229
249
log .Logf ("Waiting for the cluster to be reconciled after moving to self hosted" )
230
250
selfHostedCluster = framework .DiscoveryAndWaitForCluster (ctx , framework.DiscoveryAndWaitForClusterInput {
231
251
Getter : selfHostedClusterProxy .GetClient (),
0 commit comments