mirror of
https://github.com/status-im/consul.git
synced 2025-02-02 17:03:31 +00:00
Merge pull request #1654 from ryanslade/invalid-check-message
Updated invalid check error message.
This commit is contained in:
commit
7bc2ba4c18
@ -78,6 +78,8 @@ func (s *HTTPServer) AgentForceLeave(resp http.ResponseWriter, req *http.Request
|
|||||||
return nil, s.agent.ForceLeave(addr)
|
return nil, s.agent.ForceLeave(addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const invalidCheckMessage = "Must provide TTL or Script/DockerContainerID/HTTP/TCP and Interval"
|
||||||
|
|
||||||
func (s *HTTPServer) AgentRegisterCheck(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
func (s *HTTPServer) AgentRegisterCheck(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
|
||||||
var args CheckDefinition
|
var args CheckDefinition
|
||||||
// Fixup the type decode of TTL or Interval
|
// Fixup the type decode of TTL or Interval
|
||||||
@ -110,7 +112,7 @@ func (s *HTTPServer) AgentRegisterCheck(resp http.ResponseWriter, req *http.Requ
|
|||||||
chkType := &args.CheckType
|
chkType := &args.CheckType
|
||||||
if !chkType.Valid() {
|
if !chkType.Valid() {
|
||||||
resp.WriteHeader(400)
|
resp.WriteHeader(400)
|
||||||
resp.Write([]byte("Must provide TTL or Script and Interval!"))
|
resp.Write([]byte(invalidCheckMessage))
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +222,7 @@ func (s *HTTPServer) AgentRegisterService(resp http.ResponseWriter, req *http.Re
|
|||||||
}
|
}
|
||||||
if !check.Valid() {
|
if !check.Valid() {
|
||||||
resp.WriteHeader(400)
|
resp.WriteHeader(400)
|
||||||
resp.Write([]byte("Must provide TTL or Script and Interval!"))
|
resp.Write([]byte(invalidCheckMessage))
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user