mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Adding node_pool to job key validation (#18366)
This commit is contained in:
3
.changelog/18366.txt
Normal file
3
.changelog/18366.txt
Normal file
@@ -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"`
|
||||
AllAtOnce *bool `mapstructure:"all_at_once" hcl:"all_at_once,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"`
|
||||
Affinities []*Affinity `hcl:"affinity,block"`
|
||||
TaskGroups []*TaskGroup `hcl:"group,block"`
|
||||
|
||||
@@ -66,6 +66,7 @@ func parseJob(result *api.Job, list *ast.ObjectList) error {
|
||||
"affinity",
|
||||
"spread",
|
||||
"datacenters",
|
||||
"node_pool",
|
||||
"group",
|
||||
"id",
|
||||
"meta",
|
||||
|
||||
@@ -61,6 +61,7 @@ func TestParse(t *testing.T) {
|
||||
Datacenters: []string{"us2", "eu1"},
|
||||
Region: stringToPtr("fooregion"),
|
||||
Namespace: stringToPtr("foonamespace"),
|
||||
NodePool: stringToPtr("dev"),
|
||||
ConsulToken: stringToPtr("abc"),
|
||||
VaultToken: stringToPtr("foo"),
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
job "binstore-storagelocker" {
|
||||
region = "fooregion"
|
||||
namespace = "foonamespace"
|
||||
node_pool = "dev"
|
||||
type = "batch"
|
||||
priority = 52
|
||||
all_at_once = true
|
||||
|
||||
Reference in New Issue
Block a user