aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/cluster.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-12-11 18:11:12 +0100
committerAlex Auvolat <alex@adnab.me>2022-12-11 18:11:28 +0100
commit5ea5fd2130ee16a2030f6f74cd1a8b641b1c2487 (patch)
treecd5b8ada936db1550d1a29716c36fd4d4f6c5a41 /src/api/admin/cluster.rs
parentd7868c48a4d8d5831051a0be088fe7bbec259bca (diff)
downloadgarage-5ea5fd2130ee16a2030f6f74cd1a8b641b1c2487.tar.gz
garage-5ea5fd2130ee16a2030f6f74cd1a8b641b1c2487.zip
Always return 200 OK on /v0/health, reinstate admin api doc as draft and complete it
Diffstat (limited to 'src/api/admin/cluster.rs')
-rw-r--r--src/api/admin/cluster.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/api/admin/cluster.rs b/src/api/admin/cluster.rs
index a773e27a..f4bf8b7b 100644
--- a/src/api/admin/cluster.rs
+++ b/src/api/admin/cluster.rs
@@ -47,15 +47,10 @@ pub async fn handle_get_cluster_status(garage: &Arc<Garage>) -> Result<Response<
pub async fn handle_get_cluster_health(garage: &Arc<Garage>) -> Result<Response<Body>, Error> {
let health = garage.system.health();
- let status = match health.status {
- ClusterHealthStatus::Unavailable => StatusCode::SERVICE_UNAVAILABLE,
- _ => StatusCode::OK,
- };
-
let resp_json =
serde_json::to_string_pretty(&health).map_err(garage_util::error::Error::from)?;
Ok(Response::builder()
- .status(status)
+ .status(StatusCode::OK)
.header(http::header::CONTENT_TYPE, "application/json")
.body(Body::from(resp_json))?)
}