From dede0a34112b59034fdcfe8519e7e139e9488424 Mon Sep 17 00:00:00 2001 From: Chris Richardson Date: Thu, 3 Jul 2025 17:32:27 -0400 Subject: [PATCH] comment out --- cmd/main.go | 13 +++++++------ internal/controller/locustcluster_controller.go | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 1e5ce14..2878e51 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -25,7 +25,7 @@ import ( locustiov1alpha1 "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1" "git.lilpenguins.com/crichardson/locust-operator/internal/controller" - logging "git.lilpenguins.com/crichardson/locust-operator/internal/logging" + "git.lilpenguins.com/crichardson/locust-operator/internal/logging" "go.uber.org/zap" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -41,8 +41,8 @@ import ( ) var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") + scheme = runtime.NewScheme() + // setupLog = ctrl.Log.WithName("setup") ) func init() { @@ -89,10 +89,11 @@ func main() { */ flag.Parse() - logger := logging.CreateFileLogger(logFilePath, zap.DebugLevel) + // logger := logging.CreateFileLogger(logFilePath, zap.DebugLevel) + setupLog := logging.CreateFileLogger(logFilePath, zap.DebugLevel) // ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) - ctrl.SetLogger(logger) + ctrl.SetLogger(setupLog) // if the enable-http2 flag is false (the default), http/2 should be disabled // due to its vulnerabilities. More specifically, disabling http/2 will @@ -210,7 +211,7 @@ func main() { ctx := context.Background() if err = (&controller.LocustClusterReconciler{ Client: mgr.GetClient(), - Log: logger.WithName("controllers").WithName("LocustCluster"), + Log: setupLog.WithName("controllers").WithName("LocustCluster"), Scheme: mgr.GetScheme(), }).SetupWithManager(mgr, ctx); err != nil { setupLog.Error(err, "unable to create controller", "controller", "LocustCluster") diff --git a/internal/controller/locustcluster_controller.go b/internal/controller/locustcluster_controller.go index a8ee104..7cfc99f 100644 --- a/internal/controller/locustcluster_controller.go +++ b/internal/controller/locustcluster_controller.go @@ -18,9 +18,9 @@ package controller import ( "context" - "github.com/go-logr/logr" locustiov1alpha1 "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1" + "github.com/go-logr/logr" apps "k8s.io/api/apps/v1" batch "k8s.io/api/batch/v1" apierrors "k8s.io/apimachinery/pkg/api/errors"