diff --git a/pkg/agent/netpol/netpol.go b/pkg/agent/netpol/netpol.go index 4fd7821d1372..5dc3a3eb8e33 100644 --- a/pkg/agent/netpol/netpol.go +++ b/pkg/agent/netpol/netpol.go @@ -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)