cli: correctly use and validate job with vault token set

This PR fixes `job validate` to respect '-vault-token', '$VAULT_TOKEN',
'-vault-namespace' if set.
This commit is contained in:
Seth Hoenig
2022-05-19 11:18:06 -05:00
parent 3e8f52b7f0
commit 0a5992bd20
8 changed files with 155 additions and 42 deletions

17
command/testdata/example-basic.nomad vendored Normal file
View File

@@ -0,0 +1,17 @@
job "job1" {
type = "service"
datacenters = ["dc1"]
group "group1" {
count = 1
task "task1" {
driver = "exec"
config {
command = "/bin/sleep"
}
resources {
cpu = 1000
memory = 512
}
}
}
}

14
command/testdata/example-vault.nomad vendored Normal file
View File

@@ -0,0 +1,14 @@
job "vault" {
datacenters = ["dc1"]
group "group" {
task "task" {
driver = "docker"
config {
image = "alpine:latest"
}
vault {
policies = ["my-policy"]
}
}
}
}