Skip to content

Commit

Permalink
agent: Disallow bootstrap mode when a client. Fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Feb 23, 2014
1 parent 0a19fdd commit a49c20b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ func (c *Command) readConfig() *Config {
return nil
}

// Only allow bootstrap mode when acting as a server
if config.Bootstrap && !config.Server {
c.Ui.Error("Bootstrap mode cannot be enabled when server mode is not enabled")
return nil
}

// Warn if we are in bootstrap mode
if config.Bootstrap {
c.Ui.Error("WARNING: Bootstrap mode enabled! Do not enable unless necessary")
}

return config
}

Expand Down

0 comments on commit a49c20b

Please sign in to comment.