Set namespace for template server in agent (#10757)

* Set namespace for template server in agent

* cl++
This commit is contained in:
Vishal Nayak 2021-01-25 17:37:01 -05:00 committed by GitHub
parent fcbbc5f7d8
commit 2602675402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

3
changelog/10757.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
agent: Set namespace for template server in agent.
```

View File

@ -371,6 +371,7 @@ func (c *AgentCommand) Run(args []string) int {
// Check if a default namespace has been set
mountPath := config.AutoAuth.Method.MountPath
if cns := config.AutoAuth.Method.Namespace; cns != "" {
namespace = cns
// Only set this value if the env var is empty, otherwise we end up with a nested namespace
if ens := os.Getenv(api.EnvVaultNamespace); ens == "" {
mountPath = path.Join(cns, mountPath)