diff --git a/etcdmain/main.go b/etcdmain/main.go index e8450a8d693..06bbae56b8d 100644 --- a/etcdmain/main.go +++ b/etcdmain/main.go @@ -27,10 +27,13 @@ func Main() { checkSupportArch() if len(os.Args) > 1 { - if len(os.Getenv("ETCDCOV_ARGS")) > 0 { - rootCmd.SetArgs(strings.Split(os.Getenv("ETCDCOV_ARGS"), "\xe7\xcd")[1:]) + cmd := os.Args[1] + if covArgs := os.Getenv("ETCDCOV_ARGS"); len(covArgs) > 0 { + args := strings.Split(os.Getenv("ETCDCOV_ARGS"), "\xe7\xcd")[1:] + rootCmd.SetArgs(args) + cmd = "grpc-proxy" } - switch os.Args[1] { + switch cmd { case "gateway", "grpc-proxy": if err := rootCmd.Execute(); err != nil { fmt.Fprint(os.Stderr, err)