comment out
This commit is contained in:
24
cmd/main.go
24
cmd/main.go
@@ -28,7 +28,6 @@ import (
|
|||||||
"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"
|
|
||||||
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
|
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
|
||||||
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
_ "k8s.io/client-go/plugin/pkg/client/auth"
|
||||||
ctrl "sigs.k8s.io/controller-runtime"
|
ctrl "sigs.k8s.io/controller-runtime"
|
||||||
@@ -43,18 +42,29 @@ import (
|
|||||||
var (
|
var (
|
||||||
scheme = runtime.NewScheme()
|
scheme = runtime.NewScheme()
|
||||||
// setupLog = ctrl.Log.WithName("setup")
|
// setupLog = ctrl.Log.WithName("setup")
|
||||||
|
setupLog = logging.CreateFileLogger("/tmp/log", zap.DebugLevel)
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
|
// setupLog := logging.CreateFileLogger("/tmp/log", zap.DebugLevel)
|
||||||
|
ctrl.SetLogger(setupLog)
|
||||||
|
err := clientgoscheme.AddToScheme(scheme)
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
utilruntime.Must(locustiov1alpha1.AddToScheme(scheme))
|
}
|
||||||
|
// err := utilruntime.Must(clientgoscheme.AddToScheme(scheme))
|
||||||
|
|
||||||
|
err = locustiov1alpha1.AddToScheme(scheme)
|
||||||
|
if err != nil {
|
||||||
|
|
||||||
|
}
|
||||||
|
// utilruntime.Must(locustiov1alpha1.AddToScheme(scheme))
|
||||||
// +kubebuilder:scaffold:scheme
|
// +kubebuilder:scaffold:scheme
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint:gocyclo
|
// nolint:gocyclo
|
||||||
func main() {
|
func main() {
|
||||||
var logFilePath string
|
// var logFilePath string
|
||||||
var metricsAddr string
|
var metricsAddr string
|
||||||
var metricsCertPath, metricsCertName, metricsCertKey string
|
var metricsCertPath, metricsCertName, metricsCertKey string
|
||||||
var webhookCertPath, webhookCertName, webhookCertKey string
|
var webhookCertPath, webhookCertName, webhookCertKey string
|
||||||
@@ -80,7 +90,7 @@ func main() {
|
|||||||
flag.StringVar(&metricsCertKey, "metrics-cert-key", "tls.key", "The name of the metrics server key file.")
|
flag.StringVar(&metricsCertKey, "metrics-cert-key", "tls.key", "The name of the metrics server key file.")
|
||||||
flag.BoolVar(&enableHTTP2, "enable-http2", false,
|
flag.BoolVar(&enableHTTP2, "enable-http2", false,
|
||||||
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
|
"If set, HTTP/2 will be enabled for the metrics and webhook servers")
|
||||||
flag.StringVar(&logFilePath, "log-file", "/tmp/log", "The log file to write logs to.")
|
// flag.StringVar(&logFilePath, "log-file", "/tmp/log", "The log file to write logs to.")
|
||||||
/*
|
/*
|
||||||
opts := zap.Options{
|
opts := zap.Options{
|
||||||
Development: true,
|
Development: true,
|
||||||
@@ -90,10 +100,10 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// logger := logging.CreateFileLogger(logFilePath, zap.DebugLevel)
|
// logger := logging.CreateFileLogger(logFilePath, zap.DebugLevel)
|
||||||
setupLog := 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(setupLog)
|
// 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
|
||||||
|
|||||||
Reference in New Issue
Block a user