From 13b5c28751c45d01285dcc5fa5827f8097b3e13e Mon Sep 17 00:00:00 2001 From: Jun Gong Date: Mon, 30 Dec 2019 10:04:23 +0800 Subject: [PATCH] Fix flag bug --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 80c3103..261a332 100644 --- a/main.go +++ b/main.go @@ -83,8 +83,6 @@ const ( ) func main() { - flag.CommandLine.Parse([]string{}) - cfg, err := clientcmd.BuildConfigFromFlags(masterURL, kubeconfig) if err != nil { klog.Fatalf("Error building kubeconfig: %s", err.Error()) @@ -182,7 +180,9 @@ func main() { } func init() { + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) addFlags(pflag.CommandLine) + pflag.Parse() logs.InitLogs() defer logs.FlushLogs()