Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
This commit is contained in:
Mikolaj Pawlikowski
2021-03-12 13:27:07 +00:00
parent 1f2f00ba35
commit f93526c58f

View File

@@ -107,6 +107,7 @@ func CheckCluster(ctx context.Context) *models.ClusterHealthResults {
return &response
}
// PingAllPodsResult holds results from pinging all nodes
type PingAllPodsResult struct {
podName string
podResult models.PodResult
@@ -138,6 +139,7 @@ func checkDNS() *models.DNSResults {
return &results
}
// CheckServicePodsResult results of the /check operation
type CheckServicePodsResult struct {
podName string
checkAllPodResult models.CheckAllPodResult
@@ -145,6 +147,7 @@ type CheckServicePodsResult struct {
podIPv4 strfmt.IPv4
}
// CheckAllPods calls all neighbours and returns a detailed report
func CheckAllPods(checkAllCtx context.Context, pods map[string]*GoldpingerPod) *models.CheckAllResults {
result := models.CheckAllResults{Responses: make(map[string]models.CheckAllPodResult)}
@@ -247,6 +250,7 @@ func CheckAllPods(checkAllCtx context.Context, pods map[string]*GoldpingerPod) *
return &result
}
// HealthCheck returns a simple 200 OK response to verify the API is up
func HealthCheck() *models.HealthCheckResults {
ok := true
start := time.Now()