refactor: centralize ecstore locality runtime sources (#3808)

This commit is contained in:
Zhengchao An
2026-06-24 08:42:36 +08:00
committed by GitHub
parent 1c04b86494
commit 5b6c486b13
5 changed files with 42 additions and 16 deletions
+2 -2
View File
@@ -15,8 +15,8 @@
use crate::config::{audit, notify, oidc, set_global_storage_class, storageclass};
use crate::disk::{MIGRATING_META_BUCKET, RUSTFS_META_BUCKET};
use crate::error::{Error, Result};
use crate::global::is_first_cluster_node_local;
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
use crate::runtime_sources;
use crate::storage_api_contracts::EcstoreObjectIO;
use http::HeaderMap;
use rustfs_config::audit::{
@@ -1150,7 +1150,7 @@ where
S: EcstoreObjectIO + StorageAdminApi,
{
warn!("Configuration not found ({}): Start initializing new configuration", context);
let cfg = if is_first_cluster_node_local().await {
let cfg = if runtime_sources::first_cluster_node_is_local().await {
new_and_save_server_config(api.clone()).await?
} else {
let mut cfg = new_server_config();