diff --git a/internal/controllers/import_controller_v3.go b/internal/controllers/import_controller_v3.go index 1b94797d..75ae4d91 100644 --- a/internal/controllers/import_controller_v3.go +++ b/internal/controllers/import_controller_v3.go @@ -316,13 +316,7 @@ func (r *CAPIImportManagementV3Reconciler) reconcileNormal(ctx context.Context, func (r *CAPIImportManagementV3Reconciler) rancherClusterToCapiCluster(ctx context.Context, clusterPredicate predicate.Funcs) handler.MapFunc { log := log.FromContext(ctx) - return func(_ context.Context, o client.Object) []ctrl.Request { - cluster, ok := o.(*managementv3.Cluster) - if !ok { - log.Error(nil, fmt.Sprintf("Expected a rancher cluster but got a %T", o)) - return nil - } - + return func(_ context.Context, cluster client.Object) []ctrl.Request { labels := cluster.GetLabels() if _, ok := labels[capiClusterOwner]; !ok { log.Error(fmt.Errorf("missing label %s", capiClusterOwner), "getting rancher cluster labels")