Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.3] 🌱 self-hosted e2e should check managed fields #7567

Merged
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
20 changes: 20 additions & 0 deletions test/e2e/self_hosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,26 @@ func SelfHostedSpec(ctx context.Context, inputGetter func() SelfHostedSpecInput)
Namespace: namespace.Name,
})

// Note: clusterctl should restore the managedFields to the same as before the move,
// and thus removing any managedField entries with clusterctl as a manager. This should happen
// for all the objects processed by move, but for sake of simplicity we test only the Cluster
// object. The Cluster object has special processing for the paused field during the move to
// avoid having clusterctl as the manager of the field.
log.Logf("Ensure clusterctl does not take ownership on any fields on the self-hosted cluster")
selfHostedCluster := framework.GetClusterByName(ctx, framework.GetClusterByNameInput{
Getter: selfHostedClusterProxy.GetClient(),
Name: cluster.Name,
Namespace: selfHostedNamespace.Name,
})
hasClusterctlManagedFields := false
for _, managedField := range selfHostedCluster.GetManagedFields() {
if managedField.Manager == "clusterctl" {
hasClusterctlManagedFields = true
break
}
}
Expect(hasClusterctlManagedFields).To(BeFalse(), "clusterctl should not manage any fields on the Cluster after the move")

log.Logf("Waiting for the cluster to be reconciled after moving to self hosted")
selfHostedCluster = framework.DiscoveryAndWaitForCluster(ctx, framework.DiscoveryAndWaitForClusterInput{
Getter: selfHostedClusterProxy.GetClient(),
Expand Down