diff options
author | Mendes <mendes.oulamara@pm.me> | 2022-10-05 15:29:48 +0200 |
---|---|---|
committer | Mendes <mendes.oulamara@pm.me> | 2022-10-05 15:29:48 +0200 |
commit | ceac3713d6639f9170fc3b4475fae4a30b34483c (patch) | |
tree | bb05a4272587ab69969eba39b0e5c5e3fbb5a529 /src/api/admin | |
parent | 829f815a897b04986559910bbcbf53625adcdf20 (diff) | |
download | garage-ceac3713d6639f9170fc3b4475fae4a30b34483c.tar.gz garage-ceac3713d6639f9170fc3b4475fae4a30b34483c.zip |
modifications in several files to :
- have consistent error return types
- store the zone redundancy in a Lww
- print the error and message in the CLI (TODO: for the server Api, should msg be returned in the body response?)
Diffstat (limited to 'src/api/admin')
-rw-r--r-- | src/api/admin/cluster.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/api/admin/cluster.rs b/src/api/admin/cluster.rs index 99c6e332..630179b5 100644 --- a/src/api/admin/cluster.rs +++ b/src/api/admin/cluster.rs @@ -162,7 +162,12 @@ pub async fn handle_apply_cluster_layout( let param = parse_json_body::<ApplyRevertLayoutRequest>(req).await?; let layout = garage.system.get_cluster_layout(); - let layout = layout.apply_staged_changes(Some(param.version))?; + let (layout, msg) = layout.apply_staged_changes(Some(param.version))?; + //TODO : how to display msg ? Should it be in the Body Response ? + for s in msg.iter() { + println!("{}", s); + } + garage.system.update_cluster_layout(&layout).await?; Ok(Response::builder() |