Skip to content

Commit 9bfa765

Browse files
committed
Log consistency
1 parent 70cbf3d commit 9bfa765

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"k8s.io/apimachinery/pkg/runtime"
1010
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
1111
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
12+
"k8s.io/klog/v2"
1213
ctrl "sigs.k8s.io/controller-runtime"
1314
"sigs.k8s.io/controller-runtime/pkg/healthz"
1415
"sigs.k8s.io/controller-runtime/pkg/log/zap"
@@ -41,6 +42,7 @@ func main() {
4142
flag.Parse()
4243

4344
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
45+
klog.SetLogger(ctrl.Log)
4446
log := ctrl.Log.WithName("setup")
4547

4648
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
@@ -83,4 +85,4 @@ func main() {
8385
log.Error(err, "problem running manager")
8486
os.Exit(1)
8587
}
86-
}
88+
}

0 commit comments

Comments
 (0)