Update jobspec parsing to contain vault_token at job level and not task level
This commit is contained in:
parent
ad088db6eb
commit
fb7db1143c
|
@ -139,6 +139,7 @@ func parseJob(result *structs.Job, list *ast.ObjectList) error {
|
|||
"meta",
|
||||
"task",
|
||||
"group",
|
||||
"vault_token",
|
||||
}
|
||||
if err := checkHCLKeys(listVal, valid); err != nil {
|
||||
return multierror.Prefix(err, "job:")
|
||||
|
@ -1047,7 +1048,6 @@ func parseVault(result *structs.Vault, list *ast.ObjectList) error {
|
|||
// Check for invalid keys
|
||||
valid := []string{
|
||||
"policies",
|
||||
"token",
|
||||
}
|
||||
if err := checkHCLKeys(listVal, valid); err != nil {
|
||||
return multierror.Prefix(err, "vault ->")
|
||||
|
|
|
@ -155,7 +155,6 @@ func TestParse(t *testing.T) {
|
|||
},
|
||||
Vault: &structs.Vault{
|
||||
Policies: []string{"foo", "bar"},
|
||||
Token: "baz",
|
||||
},
|
||||
},
|
||||
&structs.Task{
|
||||
|
|
|
@ -4,6 +4,7 @@ job "binstore-storagelocker" {
|
|||
priority = 50
|
||||
all_at_once = true
|
||||
datacenters = ["us2", "eu1"]
|
||||
vault_token = "foo"
|
||||
|
||||
meta {
|
||||
foo = "bar"
|
||||
|
|
|
@ -4,6 +4,7 @@ job "binstore-storagelocker" {
|
|||
priority = 50
|
||||
all_at_once = true
|
||||
datacenters = ["us2", "eu1"]
|
||||
vault_token = "foo"
|
||||
|
||||
meta {
|
||||
foo = "bar"
|
||||
|
@ -126,7 +127,6 @@ job "binstore-storagelocker" {
|
|||
|
||||
vault {
|
||||
policies = ["foo", "bar"]
|
||||
token = "baz"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ job "binstore-storagelocker" {
|
|||
priority = 50
|
||||
all_at_once = true
|
||||
datacenters = ["us2", "eu1"]
|
||||
vault_token = "foo"
|
||||
|
||||
meta {
|
||||
foo = "bar"
|
||||
|
|
|
@ -4,6 +4,7 @@ job "binstore-storagelocker" {
|
|||
priority = 50
|
||||
all_at_once = true
|
||||
datacenters = ["us2", "eu1"]
|
||||
vault_token = "foo"
|
||||
|
||||
meta {
|
||||
foo = "bar"
|
||||
|
|
|
@ -17,11 +17,9 @@ job "binstore-storagelocker" {
|
|||
|
||||
vault {
|
||||
policies = ["foo", "bar"]
|
||||
token = "baz"
|
||||
}
|
||||
vault {
|
||||
policies = ["1", "2"]
|
||||
token = "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ job "binstore-storagelocker" {
|
|||
priority = 50
|
||||
all_at_once = true
|
||||
datacenters = ["us2", "eu1"]
|
||||
vault_token = "foo"
|
||||
|
||||
meta {
|
||||
foo = "bar"
|
||||
|
|
Loading…
Reference in New Issue