Skip to content

Commit

Permalink
Upon further review, the Timeout needs to be validate for more than s…
Browse files Browse the repository at this point in the history
…cript checks.

This value is used for Consul HTTP and TCP checks.
  • Loading branch information
sean- committed Jun 14, 2016
1 parent e43d991 commit 18ef97b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1530,17 +1530,18 @@ func (sc *ServiceCheck) validate() error {
if sc.Command == "" {
return fmt.Errorf("script type must have a valid script path")
}

if sc.Timeout <= minCheckTimeout {
return fmt.Errorf("timeout %v is lower than required minimum timeout %v", sc.Timeout, minCheckInterval)
}
default:
return fmt.Errorf(`invalid type (%+q), must be one of "http", "tcp", or "script" type`, sc.Type)
}

if sc.Interval <= minCheckInterval {
return fmt.Errorf("interval (%v) can not be lower than %v", sc.Interval, minCheckInterval)
}

if sc.Timeout <= minCheckTimeout {
return fmt.Errorf("timeout %v is lower than required minimum timeout %v", sc.Timeout, minCheckInterval)
}

return nil
}

Expand Down

0 comments on commit 18ef97b

Please sign in to comment.