Skip to content

Commit

Permalink
Use dedicated flag set for klog v2 to avoid conflicts with other pack…
Browse files Browse the repository at this point in the history
…ages

Signed-off-by: Thomas Ferrandiz <[email protected]>
  • Loading branch information
thomasferrandiz committed Apr 19, 2023
1 parent 3f07955 commit 33674fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/agent/netpol/netpol.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ func Run(ctx context.Context, nodeConfig *config.Node) error {
go hc.RunCheck(healthCh, stopCh, &wg)

//init klog v2 which is used by kube-router
klog.InitFlags(nil)
flag.Set("v", strconv.Itoa(cmds.LogConfig.VLevel))
var krFlags flag.FlagSet
klog.InitFlags(&krFlags)
krFlags.Set("v", strconv.Itoa(cmds.LogConfig.VLevel))

npc, err := netpol.NewNetworkPolicyController(client, krConfig, podInformer, npInformer, nsInformer, &sync.Mutex{},
iptablesCmdHandlers, ipSetHandlers)
Expand Down

0 comments on commit 33674fd

Please sign in to comment.