aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/cluster.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-09 12:55:36 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-09 12:55:36 +0100
commit8a2b1dd422fb57abe611d8c1cf3cb0b55f487189 (patch)
tree2109cf405af3489eff0cbdd132ea2862c844214c /src/api/admin/cluster.rs
parent523d2ecb9511f74e144cd116b942d6c1bf0f546d (diff)
downloadgarage-8a2b1dd422fb57abe611d8c1cf3cb0b55f487189.tar.gz
garage-8a2b1dd422fb57abe611d8c1cf3cb0b55f487189.zip
wip: split out layout management from System into separate LayoutManager
Diffstat (limited to 'src/api/admin/cluster.rs')
-rw-r--r--src/api/admin/cluster.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/api/admin/cluster.rs b/src/api/admin/cluster.rs
index fe8e8764..f5483451 100644
--- a/src/api/admin/cluster.rs
+++ b/src/api/admin/cluster.rs
@@ -240,7 +240,11 @@ pub async fn handle_update_cluster_layout(
.merge(&roles.update_mutator(node, layout::NodeRoleV(new_role)));
}
- garage.system.update_cluster_layout(&layout).await?;
+ garage
+ .system
+ .layout_manager
+ .update_cluster_layout(&layout)
+ .await?;
let res = format_cluster_layout(&layout);
Ok(json_ok_response(&res)?)
@@ -255,7 +259,11 @@ pub async fn handle_apply_cluster_layout(
let layout = garage.system.cluster_layout().as_ref().clone();
let (layout, msg) = layout.apply_staged_changes(Some(param.version))?;
- garage.system.update_cluster_layout(&layout).await?;
+ garage
+ .system
+ .layout_manager
+ .update_cluster_layout(&layout)
+ .await?;
let res = ApplyClusterLayoutResponse {
message: msg,
@@ -267,7 +275,11 @@ pub async fn handle_apply_cluster_layout(
pub async fn handle_revert_cluster_layout(garage: &Arc<Garage>) -> Result<Response<Body>, Error> {
let layout = garage.system.cluster_layout().as_ref().clone();
let layout = layout.revert_staged_changes()?;
- garage.system.update_cluster_layout(&layout).await?;
+ garage
+ .system
+ .layout_manager
+ .update_cluster_layout(&layout)
+ .await?;
let res = format_cluster_layout(&layout);
Ok(json_ok_response(&res)?)