Skip to content

Commit

Permalink
Merge pull request #2081 from garlick/relax_jobspec_attrs
Browse files Browse the repository at this point in the history
jobspec: allow non-string attributes
  • Loading branch information
grondo committed Mar 18, 2019
2 parents aedccca + 23565b3 commit 0afdf79
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/modules/job-ingest/schemas/jobspec.jsonschema
Expand Up @@ -99,12 +99,10 @@
"type": "object",
"properties": {
"duration": { "type": "string" }
},
"additonalProperties": { "type": "string" }
}
},
"user": {
"type": "object",
"additonalProperties": { "type": "string" }
"type": "object"
}
},
"additionalProperties": false
Expand Down
8 changes: 5 additions & 3 deletions t/jobspec/minimal-schema.json
Expand Up @@ -91,9 +91,11 @@
"type": "object",
"properties": {
"duration": { "type": "string" }
},
"additonalProperties": { "type": "string" }
}
}
},
"user": {
"type": "object"
}
},
"additionalProperties": false
},
Expand Down
20 changes: 20 additions & 0 deletions t/jobspec/valid/attributes_system.yaml
@@ -0,0 +1,20 @@
version: 1
resources:
- type: slot
count: 1
label: foo
with:
- type: node
count: 1
tasks:
- command: app
slot: foo
count:
per_slot: 1
attributes:
system:
a: "string"
b: 42
c: [ 1, 2, 3 ]
d:
foo: "string"
20 changes: 20 additions & 0 deletions t/jobspec/valid/attributes_user.yaml
@@ -0,0 +1,20 @@
version: 1
resources:
- type: slot
count: 1
label: foo
with:
- type: node
count: 1
tasks:
- command: app
slot: foo
count:
per_slot: 1
attributes:
user:
a: "string"
b: 42
c: [ 1, 2, 3 ]
d:
foo: "string"
2 changes: 1 addition & 1 deletion t/t2200-job-ingest.t
Expand Up @@ -26,7 +26,7 @@ test_valid ()
{
local rc=0
for job in $*; do
cat ${job} | ${Y2J} | ${SUBMITBENCH} -
cat ${job} | ${Y2J} | ${SUBMITBENCH} - || rc=1
done
return ${rc}
}
Expand Down

0 comments on commit 0afdf79

Please sign in to comment.