vault: set JobID in Vault metadata (#11397)

Closes: #11395 .
This commit is contained in:
Mahmood Ali 2021-10-27 07:20:29 -07:00 committed by GitHub
parent e06ff1d613
commit daf20f9788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

3
.changelog/11397.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
vault: Add JobID and TaskGroup to Vault Token metadata
```

View File

@ -997,6 +997,8 @@ func (v *vaultClient) CreateToken(ctx context.Context, a *structs.Allocation, ta
Policies: taskVault.Policies,
Metadata: map[string]string{
"AllocationID": a.ID,
"JobID": a.JobID,
"TaskGroup": a.TaskGroup,
"Task": task,
"NodeID": a.NodeID,
"Namespace": namespaceForTask,