mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Disallow -v2-deprecation>'not-yet' combined with --enable-v2
This commit is contained in:
@@ -226,6 +226,7 @@ func StartEtcd(inCfg *Config) (e *Etcd, err error) {
|
||||
ExperimentalMemoryMlock: cfg.ExperimentalMemoryMlock,
|
||||
ExperimentalTxnModeWriteWithSharedBuffer: cfg.ExperimentalTxnModeWriteWithSharedBuffer,
|
||||
ExperimentalBootstrapDefragThresholdMegabytes: cfg.ExperimentalBootstrapDefragThresholdMegabytes,
|
||||
V2Deprecation: cfg.V2DeprecationEffective(),
|
||||
}
|
||||
|
||||
if srvcfg.ExperimentalEnableDistributedTracing {
|
||||
@@ -696,6 +697,9 @@ func (e *Etcd) serveClients() (err error) {
|
||||
// Start a client server goroutine for each listen address
|
||||
var h http.Handler
|
||||
if e.Config().EnableV2 {
|
||||
if e.Config().V2DeprecationEffective().IsAtLeast(config.V2_DEPR_1_WRITE_ONLY) {
|
||||
return fmt.Errorf("--enable-v2 and --v2-deprecation=%s are mutually exclusive", e.Config().V2DeprecationEffective())
|
||||
}
|
||||
e.cfg.logger.Warn("Flag `enable-v2` is deprecated and will get removed in etcd 3.6.")
|
||||
if len(e.Config().ExperimentalEnableV2V3) > 0 {
|
||||
e.cfg.logger.Warn("Flag `experimental-enable-v2v3` is deprecated and will get removed in etcd 3.6.")
|
||||
|
||||
Reference in New Issue
Block a user