Disallow -bootstrap-expect flag in dev mode (#2464)

This commit is contained in:
Kyle Havlovitz 2016-11-03 01:54:43 -04:00 committed by GitHub
parent 9f2c965a63
commit 1b204eb88d
2 changed files with 7 additions and 1 deletions

View File

@ -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")

View File

@ -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()
}