diff --git a/.changelog/11397.txt b/.changelog/11397.txt new file mode 100644 index 00000000000..892890f2998 --- /dev/null +++ b/.changelog/11397.txt @@ -0,0 +1,3 @@ +```release-note:improvement +vault: Add JobID and TaskGroup to Vault Token metadata +``` diff --git a/nomad/vault.go b/nomad/vault.go index 3fb4abcde9c..4e8a1ff1308 100644 --- a/nomad/vault.go +++ b/nomad/vault.go @@ -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,