Skip to content

Commit 13b5c28

Browse files
committed
Fix flag bug
1 parent 39ea6ad commit 13b5c28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ const (
8383
)
8484

8585
func main() {
86-
flag.CommandLine.Parse([]string{})
87-
8886
cfg, err := clientcmd.BuildConfigFromFlags(masterURL, kubeconfig)
8987
if err != nil {
9088
klog.Fatalf("Error building kubeconfig: %s", err.Error())
@@ -182,7 +180,9 @@ func main() {
182180
}
183181

184182
func init() {
183+
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
185184
addFlags(pflag.CommandLine)
185+
pflag.Parse()
186186

187187
logs.InitLogs()
188188
defer logs.FlushLogs()

0 commit comments

Comments
 (0)