diff --git a/command/agent/command.go b/command/agent/command.go index fbfd5f9e8..f9260f1b3 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -207,6 +207,13 @@ func (c *Command) readConfig() *Config { return nil } + // Check to see if we should read the Vault token from the environment + if config.Vault.Token == "" { + if token, ok := os.LookupEnv("VAULT_TOKEN"); ok { + config.Vault.Token = token + } + } + if dev { // Skip validation for dev mode return config @@ -278,13 +285,6 @@ func (c *Command) readConfig() *Config { c.Ui.Error("WARNING: Bootstrap mode enabled! Potentially unsafe operation.") } - // Check to see if we should read the Vault token from the environment - if config.Vault.Token == "" { - if token, ok := os.LookupEnv("VAULT_TOKEN"); ok { - config.Vault.Token = token - } - } - return config }