Merge pull request #4341 from blackpiglet/3737-add-logger-for-crd-manager

Fix: add init log option for velero controller-runtime manager.
This commit is contained in:
Wenkai Yin(尹文开)
2021-11-18 13:56:14 +08:00
committed by GitHub
4 changed files with 8 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ import (
"strings"
"time"
"github.com/bombsimon/logrusr"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
@@ -302,6 +303,8 @@ func newServer(f client.Factory, config serverConfig, logger *logrus.Logger) (*s
velerov1api.AddToScheme(scheme)
corev1api.AddToScheme(scheme)
ctrl.SetLogger(logrusr.NewLogger(logger))
mgr, err := ctrl.NewManager(clientConfig, ctrl.Options{
Scheme: scheme,
Namespace: f.Namespace(),