admin api: properly eliminate irrelevant role deletions (fix #1427) (#1431)

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1431
This commit is contained in:
Alex Auvolat
2026-05-01 14:40:34 +00:00
committed by Alex
parent a2c797000f
commit 3c983ac5e0
+1 -1
View File
@@ -53,7 +53,7 @@ fn format_cluster_layout(layout: &layout::LayoutHistory) -> GetClusterLayoutResp
.roles
.items()
.iter()
.filter(|(k, _, v)| current.roles.get(k) != Some(v))
.filter(|(k, _, v)| current.roles.get(k).and_then(|vv| vv.0.as_ref()) != v.0.as_ref())
.map(|(k, _, v)| match &v.0 {
None => NodeRoleChange {
id: hex::encode(k),