Skip to content

Commit

Permalink
Merge pull request #264 from ykulazhenkov/fix-init-log
Browse files Browse the repository at this point in the history
Move logger initialization before k8s client creation
  • Loading branch information
adrianchiris authored Mar 14, 2022
2 parents 45a912b + 0679ebd commit 28d7a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func main() {
}
opts.BindFlags(flag.CommandLine)
flag.Parse()
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))

restConfig := ctrl.GetConfigOrDie()
kubeClient, err := client.New(restConfig, client.Options{Scheme: scheme})
Expand All @@ -88,7 +89,6 @@ func main() {

le := leaderelection.GetLeaderElectionConfig(kubeClient, enableLeaderElection)

ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
namespace := os.Getenv("NAMESPACE")
mgr, err := ctrl.NewManager(restConfig, ctrl.Options{
Scheme: scheme,
Expand Down

0 comments on commit 28d7a35

Please sign in to comment.