diff --git a/changelog/21297.txt b/changelog/21297.txt new file mode 100644 index 000000000..9f98fd3e0 --- /dev/null +++ b/changelog/21297.txt @@ -0,0 +1,3 @@ +```release-note:bug +agent: Fix agent generate-config to accept -namespace, VAULT_NAMESPACE, and other client-modifying flags. +``` diff --git a/command/agent_generate_config.go b/command/agent_generate_config.go index 5c42d0e59..4c25b443d 100644 --- a/command/agent_generate_config.go +++ b/command/agent_generate_config.go @@ -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") diff --git a/website/content/docs/agent-and-proxy/agent/generate-config/index.mdx b/website/content/docs/agent-and-proxy/agent/generate-config/index.mdx index f02cd8e12..ebe5f234f 100644 --- a/website/content/docs/agent-and-proxy/agent/generate-config/index.mdx +++ b/website/content/docs/agent-and-proxy/agent/generate-config/index.mdx @@ -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