refactor(runtime): guard endpoint port source (#4064)

This commit is contained in:
Zhengchao An
2026-06-29 21:56:57 +08:00
committed by GitHub
parent a5e7dda6d9
commit 7c2789e75a
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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());
}
@@ -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