From 5b85453d5ccecd911d9fff57c5153c35e176df51 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Mon, 25 Dec 2023 01:12:52 +0530 Subject: [PATCH] chore: discard logr --- manager.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manager.go b/manager.go index b7b1227..244bb02 100644 --- a/manager.go +++ b/manager.go @@ -5,13 +5,14 @@ import ( // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) // to ensure that exec-entrypoint and run can make use of them. - //"github.com/go-logr/logr" + "github.com/go-logr/logr" _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" + logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/manager" ctrlMetrics "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -36,11 +37,12 @@ func Manager(opts *ManagerOptions) (manager.Manager, error) { utilruntime.Must(opts.AddToSchemeFunc(scheme)) + logf.SetLogger(logr.Discard()) mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, LeaderElection: len(opts.LeaderElectionID) > 0, LeaderElectionID: opts.LeaderElectionID, - //Logger: logr.Discard(), + Logger: logr.Discard(), Metrics: ctrlMetrics.Options{ BindAddress: "0", },