mirror of
https://github.com/rustfs/rustfs.git
synced 2026-10-02 05:14:35 +08:00
fix(architecture): route health.rs storage imports through storage_api facade (#8143)
The health diagnostics module imported directly from crate::storage::storage_api, bypassing the architecture migration guardrail. Add a connect facade module to rustfs/src/storage_api.rs and redirect the imports. Also fix a clippy::redundant-guards lint in the coarse-flags match arm.
This commit is contained in:
@@ -36,8 +36,8 @@ use zip::{CompressionMethod, ZipWriter, write::SimpleFileOptions};
|
||||
|
||||
use super::ProfileProvenance;
|
||||
use crate::connect::DeviceIdentity;
|
||||
use crate::storage::storage_api::contract::admin::{DiskSetSelector, StorageAdminApi};
|
||||
use crate::storage::storage_api::{DiskInfoOptions, StorageDiskRpcExt};
|
||||
use crate::storage_api::connect::contract::admin::{DiskSetSelector, StorageAdminApi};
|
||||
use crate::storage_api::connect::{DiskInfoOptions, StorageDiskRpcExt};
|
||||
|
||||
pub const HEALTH_SCHEMA_VERSION: u16 = 1;
|
||||
pub const HEALTH_TOOL_ID: &str = "health.check";
|
||||
@@ -642,7 +642,7 @@ fn flags_check(observation: &HealthSourceObservation, freshness: HealthFreshness
|
||||
Some(flags) if flags.iter().any(|flag| !ALLOWED_FLAGS.contains(&flag.as_str())) => {
|
||||
(HealthRuleOutcome::Unknown, "INVALID_EVIDENCE")
|
||||
}
|
||||
Some(flags) if flags.is_empty() => (HealthRuleOutcome::Pass, "NO_COARSE_CONDITION_REPORTED"),
|
||||
Some([]) => (HealthRuleOutcome::Pass, "NO_COARSE_CONDITION_REPORTED"),
|
||||
Some(_) => (HealthRuleOutcome::Fail, "COARSE_CONDITION_REPORTED"),
|
||||
None => (HealthRuleOutcome::Unknown, "EVIDENCE_MISSING"),
|
||||
},
|
||||
|
||||
@@ -59,7 +59,7 @@ fn bucket_targets_metadata_lock_shard(bucket: &str) -> usize {
|
||||
|
||||
pub(crate) mod contract {
|
||||
pub(crate) mod admin {
|
||||
pub(crate) use super::super::storage_contracts::{DiskSetSelector, StorageAdminApi};
|
||||
pub(crate) use super::super::storage_contracts::StorageAdminApi;
|
||||
}
|
||||
|
||||
pub(crate) mod bucket {
|
||||
|
||||
@@ -242,6 +242,19 @@ pub(crate) mod server {
|
||||
}
|
||||
}
|
||||
|
||||
/// Storage surface of the connect diagnostics module
|
||||
/// (`crate::connect::diagnostics`): disk info and admin API primitives used
|
||||
/// by the health-check observation path.
|
||||
pub(crate) mod connect {
|
||||
pub(crate) mod contract {
|
||||
pub(crate) mod admin {
|
||||
pub(crate) use super::super::super::storage_contracts::{DiskSetSelector, StorageAdminApi};
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) use crate::storage::storage_api::{DiskInfoOptions, StorageDiskRpcExt};
|
||||
}
|
||||
|
||||
/// Storage surface of the site-replication service module
|
||||
/// (`crate::site_replication`, backlog#1840): bucket metadata, bucket
|
||||
/// targets, replication-config primitives, and the config-object lock
|
||||
|
||||
Reference in New Issue
Block a user