mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 08:06:54 +00:00
feat(admin): advertise site replication capabilities (#5131)
This commit is contained in:
@@ -22,6 +22,7 @@ pub enum CapabilityState {
|
||||
Supported,
|
||||
Unsupported,
|
||||
Disabled,
|
||||
#[serde(other)]
|
||||
#[default]
|
||||
Unknown,
|
||||
}
|
||||
@@ -133,4 +134,12 @@ mod tests {
|
||||
assert_eq!(decoded.1.reason.as_deref(), Some("target does not expose profiler"));
|
||||
assert!(!decoded.1.state.is_supported());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn future_capability_state_deserializes_as_unknown() {
|
||||
let status: CapabilityStatus = serde_json::from_str(r#"{"state":"future_state"}"#)
|
||||
.expect("future capability states should preserve conservative compatibility");
|
||||
|
||||
assert_eq!(status.state, CapabilityState::Unknown);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user