comment out
All checks were successful
Tests / Run on Ubuntu (push) Successful in 1m37s
Lint / Run on Ubuntu (push) Successful in 1m45s
Build images / Build docker image (push) Successful in 3m6s

This commit is contained in:
Chris Richardson
2025-07-03 17:32:27 -04:00
parent 3a68d00970
commit dede0a3411
2 changed files with 8 additions and 7 deletions

View File

@@ -25,7 +25,7 @@ import (
locustiov1alpha1 "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1" locustiov1alpha1 "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1"
"git.lilpenguins.com/crichardson/locust-operator/internal/controller" "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" "go.uber.org/zap"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -41,8 +41,8 @@ import (
) )
var ( var (
scheme = runtime.NewScheme() scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup") // setupLog = ctrl.Log.WithName("setup")
) )
func init() { func init() {
@@ -89,10 +89,11 @@ func main() {
*/ */
flag.Parse() 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(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 // if the enable-http2 flag is false (the default), http/2 should be disabled
// due to its vulnerabilities. More specifically, disabling http/2 will // due to its vulnerabilities. More specifically, disabling http/2 will
@@ -210,7 +211,7 @@ func main() {
ctx := context.Background() ctx := context.Background()
if err = (&controller.LocustClusterReconciler{ if err = (&controller.LocustClusterReconciler{
Client: mgr.GetClient(), Client: mgr.GetClient(),
Log: logger.WithName("controllers").WithName("LocustCluster"), Log: setupLog.WithName("controllers").WithName("LocustCluster"),
Scheme: mgr.GetScheme(), Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr, ctx); err != nil { }).SetupWithManager(mgr, ctx); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "LocustCluster") setupLog.Error(err, "unable to create controller", "controller", "LocustCluster")

View File

@@ -18,9 +18,9 @@ package controller
import ( import (
"context" "context"
"github.com/go-logr/logr"
locustiov1alpha1 "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1" locustiov1alpha1 "git.lilpenguins.com/crichardson/locust-operator/api/v1alpha1"
"github.com/go-logr/logr"
apps "k8s.io/api/apps/v1" apps "k8s.io/api/apps/v1"
batch "k8s.io/api/batch/v1" batch "k8s.io/api/batch/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors" apierrors "k8s.io/apimachinery/pkg/api/errors"