Skip to content

Commit

Permalink
Disallow -bootstrap-expect flag in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kyhavlov committed Nov 3, 2016
1 parent 9f2c965 commit 87d8eff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion consul/serf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 87d8eff

Please sign in to comment.