Merge pull request #11399 from johncming/remove-dup-code

etcdmain: remove duplicate codes.
This commit is contained in:
Jingyi Hu 2019-11-27 12:56:53 -08:00 committed by GitHub
commit 3275e5f064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,15 +21,12 @@ import (
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
"runtime"
"strings"
"go.etcd.io/etcd/embed"
"go.etcd.io/etcd/pkg/flags"
"go.etcd.io/etcd/pkg/logutil"
"go.etcd.io/etcd/pkg/types"
"go.etcd.io/etcd/version"
"go.uber.org/zap"
@ -377,14 +374,6 @@ func (cfg *config) configFromFile(path string) error {
return yerr
}
if cfg.ec.ListenMetricsUrlsJSON != "" {
us, err := types.NewURLs(strings.Split(cfg.ec.ListenMetricsUrlsJSON, ","))
if err != nil {
log.Fatalf("unexpected error setting up listen-metrics-urls: %v", err)
}
cfg.ec.ListenMetricsUrls = []url.URL(us)
}
if cfg.cp.FallbackJSON != "" {
if err := cfg.cf.fallback.Set(cfg.cp.FallbackJSON); err != nil {
log.Fatalf("unexpected error setting up discovery-fallback flag: %v", err)