From 06984d2e5f80fc35cd0f2dbdc2a7404ca5b202ee Mon Sep 17 00:00:00 2001 From: amakhov Date: Fri, 19 Sep 2025 09:37:10 +0300 Subject: [PATCH] Call klog.InitFlags after the check since it set the default log-level to the flagset --- cmd/agent/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index af97301a1..38a30c72c 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -35,13 +35,13 @@ func main() { flags := command.Flags() flags.AddFlagSet(o.Flags()) local := flag.NewFlagSet(os.Args[0], flag.ExitOnError) - klog.InitFlags(local) if local.Lookup("v") == nil { err := local.Set("v", "4") if err != nil { fmt.Fprintf(os.Stderr, "error setting klog flags: %v", err) } } + klog.InitFlags(local) local.VisitAll(func(fl *flag.Flag) { fl.Name = util.Normalize(fl.Name) flags.AddGoFlag(fl)