From 7c2789e75a8d0cc9c341fd7ce4d49ef1cb9a7a29 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Mon, 29 Jun 2026 21:56:57 +0800 Subject: [PATCH] refactor(runtime): guard endpoint port source (#4064) --- crates/ecstore/src/layout/endpoints.rs | 4 ++-- scripts/check_architecture_migration_rules.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ecstore/src/layout/endpoints.rs b/crates/ecstore/src/layout/endpoints.rs index e65fc14fc..ed282ec47 100644 --- a/crates/ecstore/src/layout/endpoints.rs +++ b/crates/ecstore/src/layout/endpoints.rs @@ -17,7 +17,7 @@ use crate::{ disks_layout::DisksLayout, endpoint::{Endpoint, EndpointType}, }, - runtime::global::global_rustfs_port, + runtime::sources as runtime_sources, }; use rustfs_config::{DEFAULT_UNSAFE_BYPASS_DISK_CHECK, ENV_MINIO_CI, ENV_UNSAFE_BYPASS_DISK_CHECK}; use rustfs_utils::{XHost, check_local_server_addr, get_host_ip, is_local_host}; @@ -811,7 +811,7 @@ impl EndpointServerPools { continue; } let host = endpoint.host_port(); - if endpoint.is_local && endpoint.url.port() == Some(global_rustfs_port()) && local.is_none() { + if endpoint.is_local && endpoint.url.port() == Some(runtime_sources::rustfs_port()) && local.is_none() { local = Some(host.clone()); } diff --git a/scripts/check_architecture_migration_rules.sh b/scripts/check_architecture_migration_rules.sh index 71c09546a..93fb8c832 100755 --- a/scripts/check_architecture_migration_rules.sh +++ b/scripts/check_architecture_migration_rules.sh @@ -2482,10 +2482,10 @@ fi ( cd "$ROOT_DIR" - rg -n --with-filename '\bGLOBAL_(REGION|RUSTFS_PORT)\b|\bglobalDeploymentIDPtr\b' \ + rg -n --with-filename '\bGLOBAL_(REGION|RUSTFS_PORT)\b|\bglobalDeploymentIDPtr\b|\bruntime::global::global_rustfs_port\b' \ crates rustfs fuzz \ --glob '*.rs' | - rg -v '^(crates/common/src/globals|crates/ecstore/src/runtime/global)\.rs:' || true + rg -v '^(crates/common/src/globals|crates/ecstore/src/runtime/(global|sources))\.rs:' || true ) >"$GLOBAL_RUNTIME_SCALAR_BYPASS_HITS_FILE" if [[ -s "$GLOBAL_RUNTIME_SCALAR_BYPASS_HITS_FILE" ]]; then