mirror of https://github.com/hashicorp/consul
feedback
parent
65c70e84ec
commit
4372a5221c
|
@ -672,8 +672,11 @@ var statusScores = map[string]int{
|
||||||
api.HealthPassing: 4,
|
api.HealthPassing: 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
func isStatusBetter(curr, next string) bool {
|
func getMostImportantStatus(a, b string) string {
|
||||||
return statusScores[next] < statusScores[curr]
|
if statusScores[a] < statusScores[b] {
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
func flattenChecks(
|
func flattenChecks(
|
||||||
|
@ -696,9 +699,7 @@ func flattenChecks(
|
||||||
healthStatus = api.HealthMaint
|
healthStatus = api.HealthMaint
|
||||||
break // always wins
|
break // always wins
|
||||||
}
|
}
|
||||||
if isStatusBetter(healthStatus, chk.Status) {
|
healthStatus = getMostImportantStatus(healthStatus, chk.Status)
|
||||||
healthStatus = chk.Status
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue