Move parsing of vault token above validation such that it works in dev mode
This commit is contained in:
parent
24ff5fc5b4
commit
e322f5c070
|
@ -207,6 +207,13 @@ func (c *Command) readConfig() *Config {
|
||||||
return nil
|
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 {
|
if dev {
|
||||||
// Skip validation for dev mode
|
// Skip validation for dev mode
|
||||||
return config
|
return config
|
||||||
|
@ -278,13 +285,6 @@ func (c *Command) readConfig() *Config {
|
||||||
c.Ui.Error("WARNING: Bootstrap mode enabled! Potentially unsafe operation.")
|
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
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue