mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdmain: remove duplicate codes.
This commit is contained in:
parent
419ffb77ab
commit
6c0e2d31fb
@ -21,15 +21,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/url"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"go.etcd.io/etcd/embed"
|
"go.etcd.io/etcd/embed"
|
||||||
"go.etcd.io/etcd/pkg/flags"
|
"go.etcd.io/etcd/pkg/flags"
|
||||||
"go.etcd.io/etcd/pkg/logutil"
|
"go.etcd.io/etcd/pkg/logutil"
|
||||||
"go.etcd.io/etcd/pkg/types"
|
|
||||||
"go.etcd.io/etcd/version"
|
"go.etcd.io/etcd/version"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
@ -377,14 +374,6 @@ func (cfg *config) configFromFile(path string) error {
|
|||||||
return yerr
|
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 cfg.cp.FallbackJSON != "" {
|
||||||
if err := cfg.cf.fallback.Set(cfg.cp.FallbackJSON); err != nil {
|
if err := cfg.cf.fallback.Set(cfg.cp.FallbackJSON); err != nil {
|
||||||
log.Fatalf("unexpected error setting up discovery-fallback flag: %v", err)
|
log.Fatalf("unexpected error setting up discovery-fallback flag: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user