From 18ef97bf4e5fd175652c11cb07c4f8b0dc56e6d2 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Mon, 13 Jun 2016 18:28:27 -0700 Subject: [PATCH] Upon further review, the Timeout needs to be validate for more than script checks. This value is used for Consul HTTP and TCP checks. --- nomad/structs/structs.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index 4907a579a..b7e25a3da 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1530,10 +1530,6 @@ 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) } @@ -1541,6 +1537,11 @@ func (sc *ServiceCheck) validate() error { 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 }