From 59b55da81d54d287a39e24aa7d5187371bf0001b Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 27 Jan 2020 11:39:34 -0500 Subject: [PATCH] 15954: Add ping check for health aggregator. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- sdk/go/health/aggregator.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/go/health/aggregator.go b/sdk/go/health/aggregator.go index a1ef5e0beb..90823b38b0 100644 --- a/sdk/go/health/aggregator.go +++ b/sdk/go/health/aggregator.go @@ -62,11 +62,14 @@ func (agg *Aggregator) ServeHTTP(resp http.ResponseWriter, req *http.Request) { sendErr(http.StatusUnauthorized, errUnauthorized) return } - if req.URL.Path != "/_health/all" { + if req.URL.Path == "/_health/all" { + json.NewEncoder(resp).Encode(agg.ClusterHealth()) + } else if req.URL.Path == "/_health/ping" { + resp.Write(healthyBody) + } else { sendErr(http.StatusNotFound, errNotFound) return } - json.NewEncoder(resp).Encode(agg.ClusterHealth()) if agg.Log != nil { agg.Log(req, nil) } -- 2.30.2