Skip to content

Commit 4ce8299

Browse files
committed
ClusterCacheTracker: drop unused Log field
Signed-off-by: Stefan Büringer [email protected]
1 parent 692497d commit 4ce8299

File tree

9 files changed

+2
-10
lines changed

9 files changed

+2
-10
lines changed

controllers/remote/cluster_cache_reconciler.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
// ClusterCacheReconciler is responsible for stopping remote cluster caches when
3535
// the cluster for the remote cache is being deleted.
3636
type ClusterCacheReconciler struct {
37+
// Deprecated: this field is unused and will be dropped in an upcoming release.
3738
Log logr.Logger
3839
Client client.Client
3940
Tracker *ClusterCacheTracker
@@ -44,6 +45,7 @@ type ClusterCacheReconciler struct {
4445

4546
func (r *ClusterCacheReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
4647
err := ctrl.NewControllerManagedBy(mgr).
48+
Named("remote/clustercache").
4749
For(&clusterv1.Cluster{}).
4850
WithOptions(options).
4951
WithEventFilter(predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).

controllers/remote/cluster_cache_reconciler_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ import (
2121
"fmt"
2222
"testing"
2323

24-
"github.com/go-logr/logr"
2524
. "github.com/onsi/gomega"
2625
corev1 "k8s.io/api/core/v1"
2726
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2827
"k8s.io/client-go/kubernetes/scheme"
2928
"sigs.k8s.io/controller-runtime/pkg/client"
3029
"sigs.k8s.io/controller-runtime/pkg/controller"
31-
"sigs.k8s.io/controller-runtime/pkg/log"
3230
"sigs.k8s.io/controller-runtime/pkg/manager"
3331

3432
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
@@ -93,7 +91,6 @@ func TestClusterCacheReconciler(t *testing.T) {
9391

9492
t.Log("Creating the ClusterCacheReconciler")
9593
r := &ClusterCacheReconciler{
96-
Log: logr.New(log.NullLogSink{}),
9794
Client: mgr.GetClient(),
9895
Tracker: cct,
9996
}

controlplane/kubeadm/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
238238
}
239239
if err := (&remote.ClusterCacheReconciler{
240240
Client: mgr.GetClient(),
241-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
242241
Tracker: tracker,
243242
WatchFilterValue: watchFilterValue,
244243
}).SetupWithManager(ctx, mgr, concurrency(kubeadmControlPlaneConcurrency)); err != nil {

internal/controllers/cluster/suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func TestMain(m *testing.M) {
7777
}
7878
if err := (&remote.ClusterCacheReconciler{
7979
Client: mgr.GetClient(),
80-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
8180
Tracker: tracker,
8281
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
8382
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))

internal/controllers/machine/suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func TestMain(m *testing.M) {
8080
}
8181
if err := (&remote.ClusterCacheReconciler{
8282
Client: mgr.GetClient(),
83-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
8483
Tracker: tracker,
8584
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
8685
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))

internal/controllers/machinedeployment/suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func TestMain(m *testing.M) {
8484
}
8585
if err := (&remote.ClusterCacheReconciler{
8686
Client: mgr.GetClient(),
87-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
8887
Tracker: tracker,
8988
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
9089
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))

internal/controllers/machinehealthcheck/suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func TestMain(m *testing.M) {
8080
}
8181
if err := (&remote.ClusterCacheReconciler{
8282
Client: mgr.GetClient(),
83-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
8483
Tracker: tracker,
8584
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
8685
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))

internal/controllers/machineset/suite_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func TestMain(m *testing.M) {
8484
}
8585
if err := (&remote.ClusterCacheReconciler{
8686
Client: mgr.GetClient(),
87-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
8887
Tracker: tracker,
8988
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
9089
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))

main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
283283
}
284284
if err := (&remote.ClusterCacheReconciler{
285285
Client: mgr.GetClient(),
286-
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
287286
Tracker: tracker,
288287
WatchFilterValue: watchFilterValue,
289288
}).SetupWithManager(ctx, mgr, concurrency(clusterConcurrency)); err != nil {

0 commit comments

Comments
 (0)