Explorar o código

Merge pull request #1160 from kubecost/dramich-add-klog-flags

Expose all klog args
Dan Ramich %!s(int64=4) %!d(string=hai) anos
pai
achega
963a971f62
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      pkg/cmd/commands.go

+ 4 - 2
pkg/cmd/commands.go

@@ -43,8 +43,10 @@ func Execute(costModelCmd *cobra.Command) error {
 
 
 	// initialize klog and make cobra aware of all the go flags
 	// initialize klog and make cobra aware of all the go flags
 	klog.InitFlags(nil)
 	klog.InitFlags(nil)
-	pflag.CommandLine.AddGoFlag(flag.CommandLine.Lookup("v"))
-	pflag.CommandLine.AddGoFlag(flag.CommandLine.Lookup("logtostderr"))
+
+	flag.CommandLine.VisitAll(func(f *flag.Flag) {
+		pflag.CommandLine.AddGoFlag(f)
+	})
 	pflag.CommandLine.Set("v", "3")
 	pflag.CommandLine.Set("v", "3")
 
 
 	// in the event that no directive/command is passed, we want to default to using the cost-model command
 	// in the event that no directive/command is passed, we want to default to using the cost-model command