1 Commits

Author SHA1 Message Date
Mayuresh Gaitonde
6a184933d1 Fix consul helthcheck 2018-11-20 18:16:44 -08:00

View File

@@ -110,8 +110,13 @@ func (c *ConsulMon) healthCheck(service string) (bool, error) {
} }
for _, nodeInfo := range data { for _, nodeInfo := range data {
n := nodeInfo.(map[string]interface{}) n := nodeInfo.(map[string]interface{})
if n["Node"] == c.node && n["Status"].(string) == "passing" { if n["Node"] == c.node {
return true, nil if n["Status"].(string) == "passing" {
return true, nil
} else {
glog.V(2).Infof("Consul Healthcheck returned %s status", n["Status"].(string))
return false, nil
}
} }
} }
return false, fmt.Errorf("No healcheck info found for node %s in consul", c.node) return false, fmt.Errorf("No healcheck info found for node %s in consul", c.node)