From 303ac6fd45a0316eaeb5230990e4716a73ee93eb Mon Sep 17 00:00:00 2001 From: Damien Grisonnet Date: Fri, 12 Aug 2022 18:50:41 +0200 Subject: [PATCH] cmd/adapter: recover klog flags Signed-off-by: Damien Grisonnet --- cmd/adapter/adapter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/adapter/adapter.go b/cmd/adapter/adapter.go index dcd97c3c0..40182a030 100644 --- a/cmd/adapter/adapter.go +++ b/cmd/adapter/adapter.go @@ -292,7 +292,10 @@ func main() { cmd.OpenAPIConfig.Info.Version = "1.0.0" cmd.addFlags() - cmd.Flags().AddGoFlagSet(flag.CommandLine) // make sure we get the klog flags + // make sure we get klog flags + local := flag.NewFlagSet(os.Args[0], flag.ExitOnError) + logs.AddGoFlags(local) + cmd.Flags().AddGoFlagSet(local) if err := cmd.Flags().Parse(os.Args); err != nil { klog.Fatalf("unable to parse flags: %v", err) }