Merge pull request 'cli: return info of all nodes when doing garage stats -a (fix #814)' (#953) from fix-814 into main
All checks were successful
ci/woodpecker/push/debug Pipeline was successful

Reviewed-on: #953
This commit is contained in:
Alex 2025-02-14 13:31:42 +00:00
commit a1533d2919

View file

@ -146,7 +146,12 @@ impl AdminRpcHandler {
async fn handle_stats(&self, opt: StatsOpt) -> Result<AdminRpc, Error> { async fn handle_stats(&self, opt: StatsOpt) -> Result<AdminRpc, Error> {
if opt.all_nodes { if opt.all_nodes {
let mut ret = String::new(); let mut ret = String::new();
let all_nodes = self.garage.system.cluster_layout().all_nodes().to_vec(); let mut all_nodes = self.garage.system.cluster_layout().all_nodes().to_vec();
for node in self.garage.system.get_known_nodes().iter() {
if node.is_up && !all_nodes.contains(&node.id) {
all_nodes.push(node.id);
}
}
for node in all_nodes.iter() { for node in all_nodes.iter() {
let mut opt = opt.clone(); let mut opt = opt.clone();