backport of commit 3908ec9dc44352548e08f4c86f9ad76c255ce493 (#21331)

Co-authored-by: Anton Averchenkov <84287187+averche@users.noreply.github.com>
This commit is contained in:
hc-github-team-secure-vault-core 2023-06-16 17:33:30 -04:00 committed by GitHub
parent 664860a8ca
commit 100f402ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

3
changelog/21297.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
agent: Fix agent generate-config to accept -namespace, VAULT_NAMESPACE, and other client-modifying flags.
```

View File

@ -87,7 +87,8 @@ Usage: vault agent generate-config [options] [path/to/config.hcl]
}
func (c *AgentGenerateConfigCommand) Flags() *FlagSets {
set := NewFlagSets(c.UI)
// Include client-modifying flags (-address, -namespace, etc.)
set := c.flagSet(FlagSetHTTP)
// Common Options
f := set.NewFlagSet("Command Options")

View File

@ -49,6 +49,7 @@ Generate an agent configuration file which will reference `secret/foo`:
$ vault agent generate-config \
-type="env-template" \
-exec="./my-app arg1 arg2" \
-namespace="my/ns/" \
-path="secret/foo" \
my-config.hcl