From 8ace0a14f9116c8f3e0f11ff22437e3c6aff86e7 Mon Sep 17 00:00:00 2001 From: Carlos Salas Date: Mon, 26 Feb 2024 15:42:31 +0100 Subject: [PATCH] fix: remove type casting check from mgmtv3 controller Signed-off-by: Carlos Salas --- internal/controllers/import_controller_v3.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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")