Skip to content

Commit c2bbe20

Browse files
authored
Merge pull request #1868 from valaparthvi/externally-managed-annotation
Add check for externalFleet annotation
2 parents 399a5cc + 168b277 commit c2bbe20

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

test/e2e/specs/import_gitops.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ func CreateUsingGitOpsSpec(ctx context.Context, inputGetter func() CreateUsingGi
150150
return found
151151
}, input.E2EConfig.GetIntervals(input.BootstrapClusterProxy.GetName(), "wait-rancher")...).Should(BeTrue())
152152

153+
By("Rancher cluster should have the 'provisioning.cattle.io/externally-managed' annotation")
154+
Eventually(func() bool {
155+
Eventually(komega.Get(rancherCluster), input.E2EConfig.GetIntervals(input.BootstrapClusterProxy.GetName(), "wait-rancher")...).Should(Succeed())
156+
_, found := rancherCluster.Annotations[turtlesannotations.ExternalFleetAnnotation]
157+
return found
158+
}, input.E2EConfig.GetIntervals(input.BootstrapClusterProxy.GetName(), "wait-rancher")...).Should(BeTrue())
159+
153160
By("Waiting for the CAPI cluster to be connectable using Rancher kubeconfig")
154161
turtlesframework.RancherGetClusterKubeconfig(ctx, turtlesframework.RancherGetClusterKubeconfigInput{
155162
ClusterProxy: input.BootstrapClusterProxy,

util/annotations/helpers.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const (
2929
// This is required so that logs don't get flooded with errors when project handler and cluster handler
3030
// attempt to create `ClusterOwner` and `ProjectOwner` roles.
3131
NoCreatorRBACAnnotation = "field.cattle.io/no-creator-rbac"
32+
// ExternalFleetAnnotation represents cluster provisioned and managed by external fleet.
33+
ExternalFleetAnnotation = "provisioning.cattle.io/externally-managed"
3234
// EtcdAutomaticSnapshot represents automatically generated etcd snapshot.
3335
EtcdAutomaticSnapshot = "etcd.turtles.cattle.io/automatic-snapshot"
3436
// UpstreamSystemAgentAnnotation is a cluster annotation, allowing to pull the agent binary from the github repo instead of rancher url.

0 commit comments

Comments
 (0)