diff --git a/CHANGELOG.md b/CHANGELOG.md index ba24b220..0db81c8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,11 @@ All notable changes to this project will be documented in this file. - Updated stackable image versions ([#586]). - Operator-rs: 0.25.3 -> 0.27.1 ([#591]). +- Fixed bug where ZNode ConfigMaps were not created due to labeling issues ([#592]). [#586]: https://github.com/stackabletech/zookeeper-operator/pull/586 [#591]: https://github.com/stackabletech/zookeeper-operator/pull/591 +[#592]: https://github.com/stackabletech/zookeeper-operator/pull/592 ## [0.12.0] - 2022-11-07 diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index 75cd7aca..8b2cf6ce 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -1,5 +1,4 @@ use crate::utils::build_recommended_labels; -use crate::ZK_CONTROLLER_NAME; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_operator::{ @@ -53,16 +52,18 @@ pub async fn build_discovery_configmaps( zk: &ZookeeperCluster, owner: &impl Resource, client: &stackable_operator::client::Client, + controller_name: &str, svc: &Service, chroot: Option<&str>, ) -> Result, Error> { let name = owner.meta().name.as_deref().context(NoNameSnafu)?; Ok(vec![ - build_discovery_configmap(name, owner, zk, chroot, pod_hosts(zk)?)?, + build_discovery_configmap(zk, owner, name, controller_name, chroot, pod_hosts(zk)?)?, build_discovery_configmap( - &format!("{}-nodeport", name), - owner, zk, + owner, + &format!("{}-nodeport", name), + controller_name, chroot, nodeport_hosts(client, svc, "zk").await?, )?, @@ -73,9 +74,10 @@ pub async fn build_discovery_configmaps( /// /// `hosts` will usually come from either [`pod_hosts`] or [`nodeport_hosts`]. fn build_discovery_configmap( - name: &str, - owner: &impl Resource, zk: &ZookeeperCluster, + owner: &impl Resource, + name: &str, + controller_name: &str, chroot: Option<&str>, hosts: impl IntoIterator, u16)>, ) -> Result { @@ -104,8 +106,8 @@ fn build_discovery_configmap( zk: ObjectRef::from_obj(zk), })? .with_recommended_labels(build_recommended_labels( - zk, - ZK_CONTROLLER_NAME, + owner, + controller_name, zk.image_version().context(NoVersionSnafu)?, &ZookeeperRole::Server.to_string(), "discovery", diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 7ea721fd..0f5207ed 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -311,9 +311,16 @@ pub async fn reconcile_zk(zk: Arc, ctx: Arc) -> Result