projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
16811: Add a test that system users/groups can't be deleted.
[arvados.git]
/
sdk
/
go
/
health
/
aggregator.go
diff --git
a/sdk/go/health/aggregator.go
b/sdk/go/health/aggregator.go
index acfdbb7f8fc713517628314367a65234dc7fbd3d..794adabdd3926b6b04036a6c62b1044f2e8f13d5 100644
(file)
--- a/
sdk/go/health/aggregator.go
+++ b/
sdk/go/health/aggregator.go
@@
-14,8
+14,8
@@
import (
"sync"
"time"
"sync"
"time"
- "git.
curoverse.com
/arvados.git/sdk/go/arvados"
- "git.
curoverse.com
/arvados.git/sdk/go/auth"
+ "git.
arvados.org
/arvados.git/sdk/go/arvados"
+ "git.
arvados.org
/arvados.git/sdk/go/auth"
)
const defaultTimeout = arvados.Duration(2 * time.Second)
)
const defaultTimeout = arvados.Duration(2 * time.Second)
@@
-46,6
+46,10
@@
func (agg *Aggregator) CheckHealth() error {
return nil
}
return nil
}
+func (agg *Aggregator) Done() <-chan struct{} {
+ return nil
+}
+
func (agg *Aggregator) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
agg.setupOnce.Do(agg.setup)
sendErr := func(statusCode int, err error) {
func (agg *Aggregator) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
agg.setupOnce.Do(agg.setup)
sendErr := func(statusCode int, err error) {
@@
-62,11
+66,14
@@
func (agg *Aggregator) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
sendErr(http.StatusUnauthorized, errUnauthorized)
return
}
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
}
sendErr(http.StatusNotFound, errNotFound)
return
}
- json.NewEncoder(resp).Encode(agg.ClusterHealth())
if agg.Log != nil {
agg.Log(req, nil)
}
if agg.Log != nil {
agg.Log(req, nil)
}
@@
-103,6
+110,7
@@
type ServiceHealth struct {
}
func (agg *Aggregator) ClusterHealth() ClusterHealthResponse {
}
func (agg *Aggregator) ClusterHealth() ClusterHealthResponse {
+ agg.setupOnce.Do(agg.setup)
resp := ClusterHealthResponse{
Health: "OK",
Checks: make(map[string]CheckResult),
resp := ClusterHealthResponse{
Health: "OK",
Checks: make(map[string]CheckResult),