mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Fix healthcheck handler to verify gateway backend liveness (#6218)
Fixes #6217
This commit is contained in:
parent
264cc4020f
commit
197af49c99
@ -55,6 +55,19 @@ func LivenessCheckHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
writeResponse(w, http.StatusServiceUnavailable, nil, mimeNone)
|
writeResponse(w, http.StatusServiceUnavailable, nil, mimeNone)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s := objLayer.StorageInfo(ctx)
|
||||||
|
// Gateways don't provide disk info
|
||||||
|
if s.Backend.Type == Unknown {
|
||||||
|
// ListBuckets to confirm gateway backend is up
|
||||||
|
if _, err := objLayer.ListBuckets(ctx); err != nil {
|
||||||
|
writeResponse(w, http.StatusServiceUnavailable, nil, mimeNone)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
writeResponse(w, http.StatusOK, nil, mimeNone)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var totalLocalDisks int
|
var totalLocalDisks int
|
||||||
var erroredDisks int
|
var erroredDisks int
|
||||||
for _, endpoint := range globalEndpoints {
|
for _, endpoint := range globalEndpoints {
|
||||||
|
Loading…
Reference in New Issue
Block a user