aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/system.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-28 14:25:04 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-28 14:25:04 +0100
commitc04dd8788a3764da2f307b1d10c2d56b7b0e4a61 (patch)
tree2c02648080fde466dcef7c39987d55a03d4a4399 /src/rpc/system.rs
parent539af6eac434bd94acbcabcc5bb5c10450b71c5d (diff)
downloadgarage-c04dd8788a3764da2f307b1d10c2d56b7b0e4a61.tar.gz
garage-c04dd8788a3764da2f307b1d10c2d56b7b0e4a61.zip
admin: more info in admin GetClusterStatus
Diffstat (limited to 'src/rpc/system.rs')
-rw-r--r--src/rpc/system.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rpc/system.rs b/src/rpc/system.rs
index c7d41ee4..be4aefa2 100644
--- a/src/rpc/system.rs
+++ b/src/rpc/system.rs
@@ -126,7 +126,7 @@ pub struct System {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NodeStatus {
/// Hostname of the node
- pub hostname: String,
+ pub hostname: Option<String>,
/// Replication factor configured on the node
pub replication_factor: usize,
@@ -765,9 +765,11 @@ impl EndpointHandler<SystemRpc> for System {
impl NodeStatus {
fn initial(replication_factor: usize, layout_manager: &LayoutManager) -> Self {
NodeStatus {
- hostname: gethostname::gethostname()
- .into_string()
- .unwrap_or_else(|_| "<invalid utf-8>".to_string()),
+ hostname: Some(
+ gethostname::gethostname()
+ .into_string()
+ .unwrap_or_else(|_| "<invalid utf-8>".to_string()),
+ ),
replication_factor,
layout_digest: layout_manager.layout().digest(),
meta_disk_avail: None,
@@ -777,7 +779,7 @@ impl NodeStatus {
fn unknown() -> Self {
NodeStatus {
- hostname: "?".to_string(),
+ hostname: None,
replication_factor: 0,
layout_digest: Default::default(),
meta_disk_avail: None,