From fd1d00105e094bf1e715c62e7543db36e50d84ef Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Sat, 22 Feb 2014 18:58:15 -0800 Subject: [PATCH] agent: Disallow bootstrap mode when a client. Fixes #3 --- command/agent/command.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index eab10c3db..a8c9219fd 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -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 }