Skip to content

Commit

Permalink
Validate that the kill timeout is positive
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Jan 4, 2016
1 parent d285df8 commit 62e6e88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,9 @@ func (t *Task) Validate() error {
if t.Resources == nil {
mErr.Errors = append(mErr.Errors, errors.New("Missing task resources"))
}
if t.KillTimeout.Nanoseconds() < 0 {
mErr.Errors = append(mErr.Errors, errors.New("KillTimeout must be a positive value"))
}
for idx, constr := range t.Constraints {
if err := constr.Validate(); err != nil {
outer := fmt.Errorf("Constraint %d validation failed: %s", idx+1, err)
Expand Down

0 comments on commit 62e6e88

Please sign in to comment.