mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdmain: support grpc-proxy/gateway compiled with -tags cov
This commit is contained in:
parent
5c6a6bdc5a
commit
7c22d35dff
@ -17,6 +17,7 @@ package etcdmain
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/coreos/go-systemd/daemon"
|
||||
systemdutil "github.com/coreos/go-systemd/util"
|
||||
@ -26,7 +27,13 @@ func Main() {
|
||||
checkSupportArch()
|
||||
|
||||
if len(os.Args) > 1 {
|
||||
switch os.Args[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 cmd {
|
||||
case "gateway", "grpc-proxy":
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprint(os.Stderr, err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user