Skip to content

Commit 98b8c16

Browse files
committed
webhook: Remove klog.InitFlags(nil)
to avoid panic: ``` panic: /tmp/go-build1586768671/b001/exe/webhook flag redefined: alsologtostderr goroutine 1 [running]: flag.(*FlagSet).Var(0xc0000781c0, {0x3daf2d0, 0x5566969}, {0x394a710, 0xf}, {0x39e87ee, 0x49}) /usr/lib/golang/src/flag/flag.go:1029 +0x3b9 k8s.io/klog/v2.InitFlags.func1(0xc000234990?) /home/apanatto/go/pkg/mod/k8s.io/klog/[email protected]/klog.go:447 +0x31 flag.(*FlagSet).VisitAll(0xc0003f4c40?, 0xc000785de0) /usr/lib/golang/src/flag/flag.go:458 +0x42 k8s.io/klog/v2.InitFlags(0x3dc1aa0?) /home/apanatto/go/pkg/mod/k8s.io/klog/[email protected]/klog.go:446 +0x3c main.init.0() /home/apanatto/dev/github.com/k8snetworkplumbingwg/sriov-network-operator/cmd/webhook/main.go:27 +0x15 exit status 2 ``` Signed-off-by: Andrea Panattoni <[email protected]>
1 parent 2afd133 commit 98b8c16

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

cmd/webhook/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"os"
66

77
"github.com/spf13/cobra"
8-
"k8s.io/klog/v2"
98
"sigs.k8s.io/controller-runtime/pkg/log"
109

1110
snolog "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/log"
@@ -24,7 +23,6 @@ var (
2423
)
2524

2625
func init() {
27-
klog.InitFlags(nil)
2826
snolog.BindFlags(flag.CommandLine)
2927
rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
3028
}

0 commit comments

Comments
 (0)