From cfd8b3e86dec2f0f330ee8f6fdd9c16aeaabe149 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Fri, 23 Mar 2018 05:24:20 -0700 Subject: [PATCH] embed: move "unsafe" flags to bottom Signed-off-by: Gyuho Lee --- embed/config.go | 6 +++--- embed/etcd.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/embed/config.go b/embed/config.go index c61729a64..013f3ecae 100644 --- a/embed/config.go +++ b/embed/config.go @@ -205,9 +205,6 @@ type Config struct { ListenMetricsUrls []url.URL ListenMetricsUrlsJSON string `json:"listen-metrics-urls"` - // ForceNewCluster starts a new cluster even if previously started; unsafe. - ForceNewCluster bool `json:"force-new-cluster"` - // UserHandlers is for registering users handlers and only used for // embedding etcd into other applications. // The map key is the route path for the handler, and @@ -227,6 +224,9 @@ type Config struct { ExperimentalInitialCorruptCheck bool `json:"experimental-initial-corrupt-check"` ExperimentalCorruptCheckTime time.Duration `json:"experimental-corrupt-check-time"` ExperimentalEnableV2V3 string `json:"experimental-enable-v2v3"` + + // ForceNewCluster starts a new cluster even if previously started; unsafe. + ForceNewCluster bool `json:"force-new-cluster"` } // configYAML holds the config suitable for yaml parsing diff --git a/embed/etcd.go b/embed/etcd.go index 029d5fb6e..116c4c7c1 100644 --- a/embed/etcd.go +++ b/embed/etcd.go @@ -157,7 +157,6 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) { DiscoveryURL: cfg.Durl, DiscoveryProxy: cfg.Dproxy, NewCluster: cfg.IsNewCluster(), - ForceNewCluster: cfg.ForceNewCluster, PeerTLSInfo: cfg.PeerTLSInfo, TickMs: cfg.TickMs, ElectionTicks: cfg.ElectionTicks(), @@ -173,6 +172,7 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) { CorruptCheckTime: cfg.ExperimentalCorruptCheckTime, PreVote: cfg.PreVote, Debug: cfg.Debug, + ForceNewCluster: cfg.ForceNewCluster, } srvcfg.HostWhitelist = make(map[string]struct{}, len(cfg.HostWhitelist))