Make it a bit more obvious

Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
This commit is contained in:
Mikolaj Pawlikowski
2021-03-19 13:43:40 +00:00
parent 8d5262d316
commit d0e2e25ad2

View File

@@ -154,16 +154,18 @@ func updateCounters() {
}
CountHealthyUnhealthyNodes(counterHealthy, float64(len(checkResults.PodResults))-counterHealthy)
// check DNS, but don't block the access to checkResultsMux
go func(healthy bool) {
if healthy {
nodesHealthy := int(counterHealthy) == len(checkResults.PodResults)
go func(healthySoFar bool) {
if healthySoFar {
for _, response := range *checkDNS() {
if response.Error != "" {
healthy = false
healthySoFar = false
break
}
}
}
SetClusterHealth(healthy)
}(int(counterHealthy) == len(checkResults.PodResults))
SetClusterHealth(healthySoFar)
}(nodesHealthy)
}
// collectResults simply reads results from the results channel and saves them in a map