diff --git a/virtual-kubelet/commands/root/flag.go b/virtual-kubelet/commands/root/flag.go index e599fd9..f2d1e97 100644 --- a/virtual-kubelet/commands/root/flag.go +++ b/virtual-kubelet/commands/root/flag.go @@ -15,6 +15,7 @@ package root import ( + "flag" "fmt" "os" "strings" @@ -22,6 +23,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/pflag" "github.com/virtual-kubelet/virtual-kubelet/trace/opencensus" + "k8s.io/klog" ) type mapVar map[string]string @@ -79,6 +81,13 @@ func installFlags(flags *pflag.FlagSet, c *Opts) { flags.DurationVar(&c.InformerResyncPeriod, "full-resync-period", c.InformerResyncPeriod, "how often to perform a full resync of pods between kubernetes and the provider") flags.DurationVar(&c.StartupTimeout, "startup-timeout", c.StartupTimeout, "How long to wait for the virtual-kubelet to start") + + flagset := flag.NewFlagSet("klog", flag.PanicOnError) + klog.InitFlags(flagset) + flagset.VisitAll(func(f *flag.Flag) { + f.Name = "klog." + f.Name + flags.AddGoFlag(f) + }) } func getEnv(key, defaultValue string) string {