Skip to content

Commit

Permalink
[webhook] init logger for controller-runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
  • Loading branch information
mars1024 committed Apr 3, 2020
1 parent b2d564d commit eeba4c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/webhook/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog"
"k8s.io/klog/klogr"
ctrl "sigs.k8s.io/controller-runtime"
ctrlwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
)
Expand Down Expand Up @@ -49,6 +50,9 @@ func main() {
klog.InitFlags(nil)
flag.Parse()

// set logger for controller-runtime framework
ctrl.SetLogger(klogr.New())

// Create a webhook server.
hookServer := &ctrlwebhook.Server{
Port: port,
Expand Down

0 comments on commit eeba4c0

Please sign in to comment.