From 43f1ee511ce6654e89ec80e0b56e1ef6ffe62b9d Mon Sep 17 00:00:00 2001 From: Karthik Bhat Date: Fri, 25 Oct 2024 14:41:46 +0530 Subject: [PATCH] Remove clustercache nil checks --- internal/controllers/machine/machine_controller.go | 5 ----- .../machinehealthcheck/machinehealthcheck_controller.go | 5 ----- 2 files changed, 10 deletions(-) diff --git a/internal/controllers/machine/machine_controller.go b/internal/controllers/machine/machine_controller.go index c4c7beafefc3..0d03ad53b4bc 100644 --- a/internal/controllers/machine/machine_controller.go +++ b/internal/controllers/machine/machine_controller.go @@ -1045,11 +1045,6 @@ func (r *Reconciler) watchClusterNodes(ctx context.Context, cluster *clusterv1.C return nil } - // If there is no tracker, don't watch remote nodes - if r.ClusterCache == nil { - return nil - } - return r.ClusterCache.Watch(ctx, util.ObjectKey(cluster), clustercache.WatchInput{ Name: "machine-watchNodes", Watcher: r.controller, diff --git a/internal/controllers/machinehealthcheck/machinehealthcheck_controller.go b/internal/controllers/machinehealthcheck/machinehealthcheck_controller.go index 03743d68d298..3d26a300d4a1 100644 --- a/internal/controllers/machinehealthcheck/machinehealthcheck_controller.go +++ b/internal/controllers/machinehealthcheck/machinehealthcheck_controller.go @@ -572,11 +572,6 @@ func (r *Reconciler) nodeToMachineHealthCheck(ctx context.Context, o client.Obje } func (r *Reconciler) watchClusterNodes(ctx context.Context, cluster *clusterv1.Cluster) error { - // If there is no tracker, don't watch remote nodes - if r.ClusterCache == nil { - return nil - } - return r.ClusterCache.Watch(ctx, util.ObjectKey(cluster), clustercache.WatchInput{ Name: "machinehealthcheck-watchClusterNodes", Watcher: r.controller,