feat: support specify the schedulerClusterID in host config and carry… (#1240)

feat: support specify the schedulerClusterID in host config and carry it when listing schedulers

Signed-off-by: chlins <chlins.zhang@gmail.com>
This commit is contained in:
Chlins Zhang 2025-07-21 13:31:49 +08:00 committed by GitHub
parent aedbc2ceb0
commit e53ed3411c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 19 additions and 6 deletions

View File

@ -26,6 +26,8 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GH_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
@ -55,6 +57,8 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GH_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

View File

@ -22,6 +22,8 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GH_TOKEN }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

4
Cargo.lock generated
View File

@ -939,9 +939,9 @@ dependencies = [
[[package]]
name = "dragonfly-api"
version = "2.1.43"
version = "2.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9776abc6461282d9c62e3b10fb499ad35b79163070672ca6d277b51819bb5712"
checksum = "76ef86d60ca52c206d9e4a7ae057d1451dacfc69d49421a6d28d6ae6723c4d79"
dependencies = [
"prost 0.13.5",
"prost-types 0.14.1",

View File

@ -29,7 +29,7 @@ dragonfly-client-storage = { path = "dragonfly-client-storage", version = "1.0.3
dragonfly-client-backend = { path = "dragonfly-client-backend", version = "1.0.3" }
dragonfly-client-util = { path = "dragonfly-client-util", version = "1.0.3" }
dragonfly-client-init = { path = "dragonfly-client-init", version = "1.0.3" }
dragonfly-api = "=2.1.43"
dragonfly-api = "=2.1.44"
thiserror = "2.0"
futures = "0.3.31"
reqwest = { version = "0.12.4", features = [

View File

@ -413,6 +413,11 @@ pub struct Host {
/// ip is the advertise ip of the host.
pub ip: Option<IpAddr>,
/// scheduler_cluster_id is the ID of the cluster to which the scheduler belongs.
/// NOTE: This field is used to identify the cluster to which the scheduler belongs.
/// If this flag is set, the idc, location, hostname and ip will be ignored when listing schedulers.
pub scheduler_cluster_id: Option<u64>,
}
/// Host implements Default.
@ -423,6 +428,7 @@ impl Default for Host {
location: None,
hostname: default_host_hostname(),
ip: None,
scheduler_cluster_id: None,
}
}
}

View File

@ -162,6 +162,7 @@ impl Dynconfig {
location: self.config.host.location.clone(),
version: CARGO_PKG_VERSION.to_string(),
commit: GIT_COMMIT_SHORT_HASH.to_string(),
scheduler_cluster_id: self.config.host.scheduler_cluster_id.unwrap_or(0),
})
.await
}