Skip to content

Commit fc445ca

Browse files
maltesanderclaude
andcommitted
refactor: Move discovery ConfigMap builder into zk_controller/build
Mirror trino-operator and hdfs-operator by relocating discovery.rs to zk_controller/build/discovery.rs. The zk_controller `build` module is now pub(crate) so the znode controller can reach the shared builder; both controllers build discovery ConfigMaps for a ZookeeperCluster. Pure move: no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5303445 commit fc445ca

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

rust/operator-binary/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use crate::{
4242
mod command;
4343
mod config;
4444
pub mod crd;
45-
mod discovery;
4645
mod framework;
4746
mod listener;
4847
mod operations;

rust/operator-binary/src/zk_controller.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ use crate::{
7373
security::{self, ZookeeperSecurity},
7474
v1alpha1::{self, ZookeeperServerRoleConfig},
7575
},
76-
discovery::{self, build_discovery_configmap},
7776
listener::{build_role_listener, role_listener_name},
7877
operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs},
7978
service::{
@@ -82,7 +81,7 @@ use crate::{
8281
utils::build_recommended_labels,
8382
};
8483

85-
mod build;
84+
pub(crate) mod build;
8685
mod dereference;
8786
mod validate;
8887

@@ -152,7 +151,9 @@ pub enum Error {
152151
},
153152

154153
#[snafu(display("failed to build discovery ConfigMap"))]
155-
BuildDiscoveryConfig { source: discovery::Error },
154+
BuildDiscoveryConfig {
155+
source: build::discovery::Error,
156+
},
156157

157158
#[snafu(display("failed to apply discovery ConfigMap"))]
158159
ApplyDiscoveryConfig {
@@ -447,7 +448,7 @@ pub async fn reconcile_zk(
447448
// std's SipHasher is deprecated, and DefaultHasher is unstable across Rust releases.
448449
// We don't /need/ stability, but it's still nice to avoid spurious changes where possible.
449450
let mut discovery_hash = FnvHasher::with_key(0);
450-
let discovery_cm = build_discovery_configmap(
451+
let discovery_cm = build::discovery::build_discovery_configmap(
451452
zk,
452453
zk,
453454
ZK_CONTROLLER_NAME,

rust/operator-binary/src/zk_controller/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
//! configuration.
77
88
pub mod config_map;
9+
pub mod discovery;
910
pub mod properties;
File renamed without changes.

rust/operator-binary/src/znode_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use tracing::{debug, info};
2727
use crate::{
2828
APP_NAME, OPERATOR_NAME,
2929
crd::{ZookeeperRole, security::ZookeeperSecurity, v1alpha1},
30-
discovery::{self, build_discovery_configmap},
3130
listener::role_listener_name,
31+
zk_controller::build::discovery::{self, build_discovery_configmap},
3232
};
3333

3434
mod dereference;

0 commit comments

Comments
 (0)