Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent: Fix agent generate-config to accept namespace #21297

Merged
merged 3 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/21297.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
agent: Fix agent generate-config to accept -namespace, VAULT_NAMESPACE, and other client-modifying flags.
```
3 changes: 2 additions & 1 deletion command/agent_generate_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down