ConsulWatcher: deregister if service checks fail.

This commit is contained in:
Jelmer Snoeck
2016-08-11 15:18:50 +01:00
parent 66c38b75aa
commit 81231c0b6f
2 changed files with 86 additions and 9 deletions

View File

@@ -79,15 +79,7 @@ func (cw *consulWatcher) serviceHandler(idx uint64, data interface{}) {
var del bool
for _, check := range e.Checks {
if check.ServiceName != serviceName {
continue
}
if check.ServiceID != id {
continue
}
// delete the node
// delete the node if the status is critical
if check.Status == "critical" {
del = true
break