Skip to content

Commit

Permalink
chore: discard logr
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Dec 24, 2023
1 parent 6d0fdde commit 5b85453
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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",
},
Expand Down

0 comments on commit 5b85453

Please sign in to comment.