Adding node_pool to job key validation (#18366)
This commit is contained in:
parent
9a188167cb
commit
def93200b1
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
jobspec: add `node_pool` as a valid field
|
||||||
|
```
|
|
@ -966,7 +966,7 @@ type Job struct {
|
||||||
Priority *int `hcl:"priority,optional"`
|
Priority *int `hcl:"priority,optional"`
|
||||||
AllAtOnce *bool `mapstructure:"all_at_once" hcl:"all_at_once,optional"`
|
AllAtOnce *bool `mapstructure:"all_at_once" hcl:"all_at_once,optional"`
|
||||||
Datacenters []string `hcl:"datacenters,optional"`
|
Datacenters []string `hcl:"datacenters,optional"`
|
||||||
NodePool *string `hcl:"node_pool,optional"`
|
NodePool *string `mapstructure:"node_pool" hcl:"node_pool,optional"`
|
||||||
Constraints []*Constraint `hcl:"constraint,block"`
|
Constraints []*Constraint `hcl:"constraint,block"`
|
||||||
Affinities []*Affinity `hcl:"affinity,block"`
|
Affinities []*Affinity `hcl:"affinity,block"`
|
||||||
TaskGroups []*TaskGroup `hcl:"group,block"`
|
TaskGroups []*TaskGroup `hcl:"group,block"`
|
||||||
|
|
|
@ -66,6 +66,7 @@ func parseJob(result *api.Job, list *ast.ObjectList) error {
|
||||||
"affinity",
|
"affinity",
|
||||||
"spread",
|
"spread",
|
||||||
"datacenters",
|
"datacenters",
|
||||||
|
"node_pool",
|
||||||
"group",
|
"group",
|
||||||
"id",
|
"id",
|
||||||
"meta",
|
"meta",
|
||||||
|
|
|
@ -61,6 +61,7 @@ func TestParse(t *testing.T) {
|
||||||
Datacenters: []string{"us2", "eu1"},
|
Datacenters: []string{"us2", "eu1"},
|
||||||
Region: stringToPtr("fooregion"),
|
Region: stringToPtr("fooregion"),
|
||||||
Namespace: stringToPtr("foonamespace"),
|
Namespace: stringToPtr("foonamespace"),
|
||||||
|
NodePool: stringToPtr("dev"),
|
||||||
ConsulToken: stringToPtr("abc"),
|
ConsulToken: stringToPtr("abc"),
|
||||||
VaultToken: stringToPtr("foo"),
|
VaultToken: stringToPtr("foo"),
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
job "binstore-storagelocker" {
|
job "binstore-storagelocker" {
|
||||||
region = "fooregion"
|
region = "fooregion"
|
||||||
namespace = "foonamespace"
|
namespace = "foonamespace"
|
||||||
|
node_pool = "dev"
|
||||||
type = "batch"
|
type = "batch"
|
||||||
priority = 52
|
priority = 52
|
||||||
all_at_once = true
|
all_at_once = true
|
||||||
|
|
Loading…
Reference in New Issue