Skip to content

Commit

Permalink
Merge pull request #128 from rancher-sandbox/mark_cluster_createdby
Browse files Browse the repository at this point in the history
feat: add label to Rancher cluster when we create it
  • Loading branch information
alexander-demicev authored Sep 26, 2023
2 parents 0e28a41 + b5b1324 commit 77778a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/controllers/import_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ import (
)

const (
importLabelName = "cluster-api.cattle.io/rancher-auto-import"
importLabelName = "cluster-api.cattle.io/rancher-auto-import"
ownedLabelName = "cluster-api.cattle.io/owned"

defaultRequeueDuration = 1 * time.Minute
clusterRegistrationTokenName = "default-token"
)
Expand Down Expand Up @@ -238,6 +240,9 @@ func (r *CAPIImportReconciler) reconcileNormal(ctx context.Context, capiCluster
Name: capiCluster.Name,
UID: capiCluster.UID,
}},
Labels: map[string]string{
ownedLabelName: "",
},
},
}); err != nil {
return ctrl.Result{}, fmt.Errorf("error creating rancher cluster: %w", err)
Expand Down

0 comments on commit 77778a8

Please sign in to comment.