-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jobspec: check min/max as ints, not unsigned
Problem: because min/max in resource counts are read in as unsinged, negative values in the jobspec may still pass validation Change the value checks for min/max to use the input values cast to signed types to ensure negative inputs are caught
- Loading branch information
1 parent
b348925
commit 17a1c5d
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
t/data/resource/jobspecs/validation/invalid/resource_count_negative_max.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 9999 | ||
resources: | ||
- type: slot | ||
count: | ||
min: 1 | ||
max: -1 | ||
operator: "+" | ||
operand: 1 | ||
label: foo | ||
with: | ||
- type: node | ||
count: 1 | ||
tasks: | ||
- command: [ "app" ] | ||
slot: foo | ||
count: | ||
per_slot: 1 | ||
attributes: |