jobspec: support cluster field for Vault block (#18408)

This field supports the upcoming ENT-only multiple Vault clusters feature. The
job validation and mutation hooks will come in a separate PR.

Ref: https://github.com/hashicorp/team-nomad/issues/404
This commit is contained in:
Tim Gross
2023-09-07 10:15:28 -04:00
committed by GitHub
parent c145e8b30f
commit 7cdd592809
6 changed files with 20 additions and 0 deletions

View File

@@ -1292,6 +1292,7 @@ func ApiTaskToStructsTask(job *structs.Job, group *structs.TaskGroup,
Role: apiTask.Vault.Role,
Policies: apiTask.Vault.Policies,
Namespace: *apiTask.Vault.Namespace,
Cluster: apiTask.Vault.Cluster,
Env: *apiTask.Vault.Env,
DisableFile: *apiTask.Vault.DisableFile,
ChangeMode: *apiTask.Vault.ChangeMode,

View File

@@ -3214,6 +3214,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Vault: &structs.Vault{
Role: "nomad-task",
Namespace: "ns1",
Cluster: "default",
Policies: []string{"a", "b", "c"},
Env: true,
DisableFile: false,