Skip to content

Commit

Permalink
Merge pull request #6318 from sbueringer/pr-drop-unused-logger
Browse files Browse the repository at this point in the history
馃尡 ClusterCacheTracker: drop unused Log field
  • Loading branch information
k8s-ci-robot committed Mar 28, 2022
2 parents 514e2aa + 4ce8299 commit d61b7b9
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 10 deletions.
2 changes: 2 additions & 0 deletions controllers/remote/cluster_cache_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
// ClusterCacheReconciler is responsible for stopping remote cluster caches when
// the cluster for the remote cache is being deleted.
type ClusterCacheReconciler struct {
// Deprecated: this field is unused and will be dropped in an upcoming release.
Log logr.Logger
Client client.Client
Tracker *ClusterCacheTracker
Expand All @@ -44,6 +45,7 @@ type ClusterCacheReconciler struct {

func (r *ClusterCacheReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
err := ctrl.NewControllerManagedBy(mgr).
Named("remote/clustercache").
For(&clusterv1.Cluster{}).
WithOptions(options).
WithEventFilter(predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)).
Expand Down
3 changes: 0 additions & 3 deletions controllers/remote/cluster_cache_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ import (
"fmt"
"testing"

"github.com/go-logr/logr"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/manager"

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

t.Log("Creating the ClusterCacheReconciler")
r := &ClusterCacheReconciler{
Log: logr.New(log.NullLogSink{}),
Client: mgr.GetClient(),
Tracker: cct,
}
Expand Down
1 change: 0 additions & 1 deletion controlplane/kubeadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
WatchFilterValue: watchFilterValue,
}).SetupWithManager(ctx, mgr, concurrency(kubeadmControlPlaneConcurrency)); err != nil {
Expand Down
1 change: 0 additions & 1 deletion internal/controllers/cluster/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func TestMain(m *testing.M) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))
Expand Down
1 change: 0 additions & 1 deletion internal/controllers/machine/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func TestMain(m *testing.M) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))
Expand Down
1 change: 0 additions & 1 deletion internal/controllers/machinedeployment/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func TestMain(m *testing.M) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))
Expand Down
1 change: 0 additions & 1 deletion internal/controllers/machinehealthcheck/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func TestMain(m *testing.M) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))
Expand Down
1 change: 0 additions & 1 deletion internal/controllers/machineset/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func TestMain(m *testing.M) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: 1}); err != nil {
panic(fmt.Sprintf("Failed to start ClusterCacheReconciler: %v", err))
Expand Down
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
}
if err := (&remote.ClusterCacheReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("remote").WithName("ClusterCacheReconciler"),
Tracker: tracker,
WatchFilterValue: watchFilterValue,
}).SetupWithManager(ctx, mgr, concurrency(clusterConcurrency)); err != nil {
Expand Down

0 comments on commit d61b7b9

Please sign in to comment.