Merge pull request #678 from fanyangyang/fix/coding/717

check etcd args and append
This commit is contained in:
黄润豪 2020-02-15 23:28:40 +08:00 committed by GitHub
commit c611023c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -136,6 +136,9 @@ func NewConfig() *Config {
//AddFlag monitor flag
func (c *Config) AddFlag(cmd *pflag.FlagSet) {
cmd.StringVar(&c.EtcdEndpointsLine, "etcd-endpoints", c.EtcdEndpointsLine, "etcd endpoints list.")
cmd.StringVar(&c.EtcdCaFile, "etcd-ca", "", "etcd tls ca file ")
cmd.StringVar(&c.EtcdCertFile, "etcd-cert", "", "etcd tls cert file")
cmd.StringVar(&c.EtcdKeyFile, "etcd-key", "", "etcd http tls cert key file")
cmd.StringVar(&c.AdvertiseAddr, "advertise-addr", c.AdvertiseAddr, "advertise address, and registry into etcd.")
cmd.IntVar(&c.CadvisorListenPort, "cadvisor-listen-port", c.CadvisorListenPort, "kubelet cadvisor listen port in all node")
cmd.StringSliceVar(&c.AlertManagerURL, "alertmanager-address", c.AlertManagerURL, "AlertManager url.")

View File

@ -54,6 +54,9 @@ func (a *MQServer) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&a.LogLevel, "log-level", "info", "the mq log level")
fs.StringSliceVar(&a.EtcdEndPoints, "etcd-endpoints", []string{"http://127.0.0.1:2379"}, "etcd v3 cluster endpoints.")
fs.IntVar(&a.EtcdTimeout, "etcd-timeout", 10, "etcd http timeout seconds")
fs.StringVar(&a.EtcdCaFile, "etcd-ca", "", "etcd tls ca file ")
fs.StringVar(&a.EtcdCertFile, "etcd-cert", "", "etcd tls cert file")
fs.StringVar(&a.EtcdKeyFile, "etcd-key", "", "etcd http tls cert key file")
fs.StringVar(&a.EtcdPrefix, "etcd-prefix", "/mq", "the etcd data save key prefix ")
fs.IntVar(&a.APIPort, "api-port", 6300, "the api server listen port")
fs.StringVar(&a.RunMode, "mode", "grpc", "the api server run mode grpc or http")

View File

@ -55,6 +55,9 @@ func NewWebCliServer() *WebCliServer {
func (a *WebCliServer) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&a.LogLevel, "log-level", "info", "the webcli log level")
fs.StringSliceVar(&a.EtcdEndPoints, "etcd-endpoints", []string{"http://127.0.0.1:2379"}, "etcd v3 cluster endpoints.")
fs.StringVar(&a.EtcdCaFile, "etcd-ca", "", "etcd tls ca file ")
fs.StringVar(&a.EtcdCertFile, "etcd-cert", "", "etcd tls cert file")
fs.StringVar(&a.EtcdKeyFile, "etcd-key", "", "etcd http tls cert key file")
fs.StringVar(&a.Address, "address", "0.0.0.0", "server listen address")
fs.StringVar(&a.HostIP, "hostIP", "", "Current node Intranet IP")
fs.StringVar(&a.HostName, "hostName", "", "Current node host name")