From 1b204eb88d85161c4f8bc7483401063b76ce1c99 Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Thu, 3 Nov 2016 01:54:43 -0400 Subject: [PATCH] Disallow -bootstrap-expect flag in dev mode (#2464) --- command/agent/command.go | 6 ++++++ consul/serf.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/command/agent/command.go b/command/agent/command.go index 30a3cf20e6..dcf0e534ac 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -271,6 +271,12 @@ func (c *Command) readConfig() *Config { return nil } + // Expect can only work when dev mode is off + if config.BootstrapExpect > 0 && config.DevMode { + c.Ui.Error("Expect mode cannot be enabled when dev mode is enabled") + return nil + } + // Expect & Bootstrap are mutually exclusive if config.BootstrapExpect != 0 && config.Bootstrap { c.Ui.Error("Bootstrap cannot be provided with an expected server count") diff --git a/consul/serf.go b/consul/serf.go index 1e089ac38c..af2d2de979 100644 --- a/consul/serf.go +++ b/consul/serf.go @@ -154,7 +154,7 @@ func (s *Server) lanNodeJoin(me serf.MemberEvent) { s.localLock.Unlock() } - // If we still expecting to bootstrap, may need to handle this. + // If we're still expecting to bootstrap, may need to handle this. if s.config.BootstrapExpect != 0 { s.maybeBootstrap() }