Skip to content

Commit

Permalink
Core: CLI imporvement VAULT_ADDR Warning message. Resolves #9684.
Browse files Browse the repository at this point in the history
  • Loading branch information
aphorise committed Sep 9, 2022
1 parent df66c4d commit 7fe917d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/17075.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
core/cli: Warning related to VAULT_ADDR & -address not set with CLI requests.
```
3 changes: 3 additions & 0 deletions command/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ func (c *BaseCommand) flagSet(bit FlagSetBit) *FlagSets {
addrStringVar.Default = c.flagAddress
} else {
addrStringVar.Default = "https://127.0.0.1:8200"
if os.Getenv("VAULT_ADDR") == "" {
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 7fe917d

Please sign in to comment.