forked from TrueCloudLab/frostfs-s3-gw
NFSSVC-25 Isolate health-checkers
- Add mime-type for health-check response - Remove legacy health-checkers
This commit is contained in:
parent
4098bfda9c
commit
1c6da41bee
2 changed files with 5 additions and 5 deletions
|
@ -12,8 +12,9 @@ type Healthy interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
healthyState = "NeoFS S3 Gateway is "
|
healthyState = "NeoFS S3 Gateway is "
|
||||||
// defaultContentType = "text/plain; charset=utf-8"
|
hdrContentType = "Content-Type"
|
||||||
|
defaultContentType = "text/plain; charset=utf-8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func attachHealthy(r *mux.Router, h Healthy) {
|
func attachHealthy(r *mux.Router, h Healthy) {
|
||||||
|
@ -22,6 +23,7 @@ func attachHealthy(r *mux.Router, h Healthy) {
|
||||||
StrictSlash(true)
|
StrictSlash(true)
|
||||||
|
|
||||||
healthy.HandleFunc("/ready", func(w http.ResponseWriter, r *http.Request) {
|
healthy.HandleFunc("/ready", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set(hdrContentType, defaultContentType)
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = fmt.Fprintln(w, healthyState+"ready")
|
_, _ = fmt.Fprintln(w, healthyState+"ready")
|
||||||
})
|
})
|
||||||
|
@ -35,6 +37,7 @@ func attachHealthy(r *mux.Router, h Healthy) {
|
||||||
code = http.StatusBadRequest
|
code = http.StatusBadRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w.Header().Set(hdrContentType, defaultContentType)
|
||||||
w.WriteHeader(code)
|
w.WriteHeader(code)
|
||||||
_, _ = fmt.Fprintln(w, healthyState+msg)
|
_, _ = fmt.Fprintln(w, healthyState+msg)
|
||||||
})
|
})
|
||||||
|
|
|
@ -41,9 +41,6 @@ func AttachS3API(r *mux.Router, obj ObjectLayer, l *zap.Logger) {
|
||||||
globalServerConfigMu.Unlock()
|
globalServerConfigMu.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add healthcheck router
|
|
||||||
registerHealthCheckRouter(r)
|
|
||||||
|
|
||||||
// Add API router.
|
// Add API router.
|
||||||
registerAPIRouter(r, true, true)
|
registerAPIRouter(r, true, true)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue