From fcc6a2ca13c4a712677ecf8a675548e83c99e6c4 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Fri, 5 Apr 2019 17:11:41 +0000 Subject: [PATCH] agent config: cleaner VAULT_ env lookup --- command/agent/command.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index d30958a5b..34567c0e2 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -256,16 +256,12 @@ func (c *Command) readConfig() *Config { // 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 - } + config.Vault.Token = os.Getenv("VAULT_TOKEN") } // Check to see if we should read the Vault namespace from the environment if config.Vault.Namespace == "" { - if ns, ok := os.LookupEnv("VAULT_NAMESPACE"); ok { - config.Vault.Namespace = ns - } + config.Vault.Namespace = os.Getenv("VAULT_NAMESPACE") } // Default the plugin directory to be under that of the data directory if it