|
|
@ -19,6 +19,7 @@ package cmd |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"strconv" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// ClusterCheckHandler returns if the server is ready for requests.
|
|
|
|
// ClusterCheckHandler returns if the server is ready for requests.
|
|
|
@ -38,6 +39,8 @@ func ClusterCheckHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
opts := HealthOptions{Maintenance: r.URL.Query().Get("maintenance") == "true"} |
|
|
|
opts := HealthOptions{Maintenance: r.URL.Query().Get("maintenance") == "true"} |
|
|
|
result := objLayer.Health(ctx, opts) |
|
|
|
result := objLayer.Health(ctx, opts) |
|
|
|
if !result.Healthy { |
|
|
|
if !result.Healthy { |
|
|
|
|
|
|
|
// return how many drives are being healed if any
|
|
|
|
|
|
|
|
w.Header().Set("X-Minio-Healing-Drives", strconv.Itoa(result.HealingDrives)) |
|
|
|
// As a maintenance call we are purposefully asked to be taken
|
|
|
|
// As a maintenance call we are purposefully asked to be taken
|
|
|
|
// down, this is for orchestrators to know if we can safely
|
|
|
|
// down, this is for orchestrators to know if we can safely
|
|
|
|
// take this server down, return appropriate error.
|
|
|
|
// take this server down, return appropriate error.
|
|
|
|