Skip to content

Commit

Permalink
Core: CLI imporvement to show Warning message when VAULT_ADDR or -add…
Browse files Browse the repository at this point in the history
…ress is not set. Resolves hashicorp#9684. Feedback.
  • Loading branch information
aphorise committed Sep 7, 2022
1 parent 6f3328f commit 37eca91
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions command/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,8 @@ func (c *BaseCommand) flagSet(bit FlagSetBit) *FlagSets {
addrStringVar.Default = c.flagAddress
} else {
addrStringVar.Default = "https://127.0.0.1:8200"
// if no VAULT_ADDR or -address provided then give warning.
if os.Getenv("VAULT_ADDR") == "" {
c.UI.Warn("WARNING: neither VAULT_ADDR nor the -address parameter is set. Defaulting to loopback address (https://127.0.0.1:8200).")
c.UI.Warn(wrapAtLength(fmt.Sprintf("WARNING! VAULT_ADDR and -address unset. Defaulting to %s.", addrStringVar.Default)))
}
}
f.StringVar(addrStringVar)
Expand Down

0 comments on commit 37eca91

Please sign in to comment.