From fca3d49bfa125c2d437b683544039cf2883e60b6 Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 29 Apr 2026 15:30:34 +0200 Subject: [PATCH 1/4] feat: Support dynamic image repositories --- Cargo.lock | 25 ++++++++-------- Cargo.nix | 30 ++++++++++++-------- Cargo.toml | 2 +- crate-hashes.json | 18 ++++++------ extra/crds.yaml | 17 +++++++---- rust/operator-binary/src/main.rs | 2 ++ rust/operator-binary/src/zk_controller.rs | 12 ++++++-- rust/operator-binary/src/znode_controller.rs | 10 +++++-- 8 files changed, 72 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ae28425..840109bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1511,7 +1511,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "darling", "regex", @@ -2830,7 +2830,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stackable-certs" version = "0.4.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "const-oid", "ecdsa", @@ -2853,8 +2853,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.110.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +version = "0.111.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "base64", "clap", @@ -2895,7 +2895,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "darling", "proc-macro2", @@ -2906,7 +2906,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "jiff", "k8s-openapi", @@ -2923,7 +2923,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "axum", "clap", @@ -2946,9 +2946,10 @@ dependencies = [ [[package]] name = "stackable-versioned" -version = "0.9.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +version = "0.10.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ + "kube", "schemars", "serde", "serde_json", @@ -2959,8 +2960,8 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" -version = "0.9.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +version = "0.10.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "convert_case", "convert_case_extras", @@ -2978,7 +2979,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#96f42571ea185a3cd76fedde351fcabbeefcae16" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#7a5f0c3fbcd091340214a23f0607fcd4b4fcc152" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 01f016ce..64104b87 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4810,7 +4810,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "k8s_version"; @@ -9332,7 +9332,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "stackable_certs"; @@ -9430,12 +9430,12 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.110.1"; + version = "0.111.1"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "stackable_operator"; @@ -9615,7 +9615,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; procMacro = true; @@ -9650,7 +9650,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "stackable_shared"; @@ -9731,7 +9731,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "stackable_telemetry"; @@ -9836,12 +9836,12 @@ rec { }; "stackable-versioned" = rec { crateName = "stackable-versioned"; - version = "0.9.0"; + version = "0.10.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "stackable_versioned"; @@ -9849,6 +9849,12 @@ rec { "Stackable GmbH " ]; dependencies = [ + { + name = "kube"; + packageId = "kube"; + usesDefaultFeatures = false; + features = [ "client" "jsonpatch" "runtime" "derive" "admission" "rustls-tls" "ring" ]; + } { name = "schemars"; packageId = "schemars"; @@ -9880,12 +9886,12 @@ rec { }; "stackable-versioned-macros" = rec { crateName = "stackable-versioned-macros"; - version = "0.9.0"; + version = "0.10.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; procMacro = true; @@ -9953,7 +9959,7 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "96f42571ea185a3cd76fedde351fcabbeefcae16"; + rev = "7a5f0c3fbcd091340214a23f0607fcd4b4fcc152"; sha256 = "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by"; }; libName = "stackable_webhook"; diff --git a/Cargo.toml b/Cargo.toml index 8beeee65..2fc17c4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/zookeeper-operator" [workspace.dependencies] product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.110.1", features = ["webhook"] } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["webhook"] } anyhow = "1.0" built = { version = "0.8", features = ["chrono", "git2"] } diff --git a/crate-hashes.json b/crate-hashes.json index e19b553d..a6396ca0 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,12 +1,12 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#k8s-version@0.1.3": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-certs@0.4.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-operator-derive@0.3.1": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-operator@0.110.1": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-shared@0.1.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-telemetry@0.6.3": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-versioned-macros@0.9.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-versioned@0.9.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.110.1#stackable-webhook@0.9.1": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#k8s-version@0.1.3": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-certs@0.4.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-operator-derive@0.3.1": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-operator@0.111.1": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-shared@0.1.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-telemetry@0.6.3": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-versioned-macros@0.10.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-versioned@0.10.0": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.111.1#stackable-webhook@0.9.1": "0d58yvxvy8hbai12bjhcyvh4zw182j5dsfyqja4k2xc1vzjy29by", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/extra/crds.yaml b/extra/crds.yaml index 3a6554c1..a5e67469 100644 --- a/extra/crds.yaml +++ b/extra/crds.yaml @@ -145,8 +145,9 @@ spec: properties: custom: description: |- - Overwrite the docker image. - Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0` + Provide a custom container image. + + Specify the full container image name, e.g. `oci.example.tech/namespace/superset:1.4.1-my-tag` type: string productVersion: description: Version of the product, e.g. `1.4.1`. @@ -173,14 +174,20 @@ spec: nullable: true type: array repo: - description: Name of the docker repo, e.g. `oci.stackable.tech/sdp` + description: |- + The repository on the container image registry where the container image is located, e.g. + `oci.example.com/namespace`. + + If not specified, the operator will use the image registry provided via the operator + environment options. nullable: true type: string stackableVersion: description: |- Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`. - If not specified, the operator will use its own version, e.g. `23.4.1`. - When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image. + + If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly + operator or a PR version, it will use the nightly `0.0.0-dev` image. nullable: true type: string type: object diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 75ec00e1..c0adf5ff 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -158,6 +158,7 @@ async fn main() -> anyhow::Result<()> { zk_controller::reconcile_zk, zk_controller::error_policy, Arc::new(zk_controller::Ctx { + operator_environment: operator_environment.clone(), client: client.clone(), product_config, }), @@ -224,6 +225,7 @@ async fn main() -> anyhow::Result<()> { znode_controller::error_policy, Arc::new(znode_controller::Ctx { client: client.clone(), + operator_environment, }), ) // We can let the reporting happen in the background diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 4fb8b5ed..a706c600 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -28,6 +28,7 @@ use stackable_operator::{ volume::{ListenerOperatorVolumeSourceBuilder, ListenerReference}, }, }, + cli::OperatorEnvironmentOptions, cluster_resources::{ClusterResourceApplyStrategy, ClusterResources}, commons::{ product_image_selection::{self, ResolvedProductImage}, @@ -80,7 +81,7 @@ use crate::{ command::create_init_container_command_args, config::jvm::{construct_non_heap_jvm_args, construct_zk_server_heap_env}, crd::{ - DOCKER_IMAGE_BASE_NAME, JMX_METRICS_PORT_NAME, JVM_SECURITY_PROPERTIES_FILE, + CONTAINER_IMAGE_BASE_NAME, JMX_METRICS_PORT_NAME, JVM_SECURITY_PROPERTIES_FILE, MAX_PREPARE_LOG_FILE_SIZE, MAX_ZK_LOG_FILES_SIZE, METRICS_PROVIDER_HTTP_PORT_NAME, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_ELECTION_PORT, ZOOKEEPER_ELECTION_PORT_NAME, @@ -108,6 +109,7 @@ pub const LISTENER_VOLUME_DIR: &str = "/stackable/listener"; pub struct Ctx { pub client: stackable_operator::client::Client, pub product_config: ProductConfigManager, + pub operator_environment: OperatorEnvironmentOptions, } type Result = std::result::Result; @@ -365,7 +367,11 @@ pub async fn reconcile_zk( let resolved_product_image = zk .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION) + .resolve( + CONTAINER_IMAGE_BASE_NAME, + &ctx.operator_environment.image_repository, + crate::built_info::PKG_VERSION, + ) .context(ResolveProductImageSnafu)?; let mut cluster_resources = ClusterResources::new( @@ -1149,7 +1155,7 @@ mod tests { let resolved_product_image = zookeeper .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev") + .resolve(CONTAINER_IMAGE_BASE_NAME, "oci.example.org", "0.0.0-dev") .expect("test resolved product image is always valid"); let validated_config = validate_all_roles_and_groups_config( diff --git a/rust/operator-binary/src/znode_controller.rs b/rust/operator-binary/src/znode_controller.rs index a76e8621..a1d79c89 100644 --- a/rust/operator-binary/src/znode_controller.rs +++ b/rust/operator-binary/src/znode_controller.rs @@ -6,6 +6,7 @@ use std::{borrow::Cow, convert::Infallible, sync::Arc}; use const_format::concatcp; use snafu::{OptionExt, ResultExt, Snafu}; use stackable_operator::{ + cli::OperatorEnvironmentOptions, cluster_resources::{ClusterResourceApplyStrategy, ClusterResources}, commons::product_image_selection::{self, ResolvedProductImage}, crd::listener, @@ -25,7 +26,7 @@ use tracing::{debug, info}; use crate::{ APP_NAME, OPERATOR_NAME, - crd::{DOCKER_IMAGE_BASE_NAME, ZookeeperRole, security::ZookeeperSecurity, v1alpha1}, + crd::{CONTAINER_IMAGE_BASE_NAME, ZookeeperRole, security::ZookeeperSecurity, v1alpha1}, discovery::{self, build_discovery_configmap}, listener::role_listener_name, }; @@ -35,6 +36,7 @@ pub const ZNODE_FULL_CONTROLLER_NAME: &str = concatcp!(ZNODE_CONTROLLER_NAME, '. pub struct Ctx { pub client: stackable_operator::client::Client, + pub operator_environment: OperatorEnvironmentOptions, } #[derive(Snafu, Debug, EnumDiscriminants)] @@ -253,7 +255,11 @@ pub async fn reconcile_znode( let resolved_product_image = zk .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION) + .resolve( + CONTAINER_IMAGE_BASE_NAME, + &ctx.operator_environment.image_repository, + crate::built_info::PKG_VERSION, + ) .context(ResolveProductImageSnafu)?; reconcile_apply(client, &znode, Ok(zk), &znode_path, &resolved_product_image) .await From a7b23ffa1bdbdbcf8e488f9032b797655f18738f Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 29 Apr 2026 15:30:44 +0200 Subject: [PATCH 2/4] test: Add placeholder values to satify roundtrip tests --- rust/operator-binary/src/crd/mod.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 65953bc0..90179fc3 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -85,7 +85,7 @@ pub const MAX_PREPARE_LOG_FILE_SIZE: MemoryQuantity = MemoryQuantity { unit: BinaryMultiple::Mebi, }; -pub const DOCKER_IMAGE_BASE_NAME: &str = "zookeeper"; +pub const CONTAINER_IMAGE_BASE_NAME: &str = "zookeeper"; const DEFAULT_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT: Duration = Duration::from_minutes_unchecked(2); pub const DEFAULT_LISTENER_CLASS: &str = "cluster-internal"; @@ -750,6 +750,8 @@ impl v1alpha1::ZookeeperCluster { #[cfg(test)] mod tests { + use stackable_operator::versioned::test_utils::RoundtripTestData; + use super::*; fn get_server_secret_class(zk: &v1alpha1::ZookeeperCluster) -> Option<&str> { @@ -929,4 +931,16 @@ mod tests { tls::quorum_tls_default().as_str() ); } + + impl RoundtripTestData for v1alpha1::ZookeeperClusterSpec { + fn roundtrip_test_data() -> Vec { + vec![] + } + } + + impl RoundtripTestData for v1alpha1::ZookeeperZnodeSpec { + fn roundtrip_test_data() -> Vec { + vec![] + } + } } From e92696548d9b8b2860a7d159d51b428cb2262509 Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 29 Apr 2026 15:32:41 +0200 Subject: [PATCH 3/4] chore: Add changelog entry --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ff1d78b..e06a3cbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,21 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- BREAKING: Add required CLI argument and env var to set the image repository used to construct final product image names: `IMAGE_REPOSITORY` (`--image-repository`), eg. `oci.example.org/my/namespace` ([#1028]). + ### Changed - Document Helm deployed RBAC permissions and remove unnecessary permissions ([#1020]). - BREAKING: `configOverrides` now only accepts the known config files (`zoo.cfg` and `security.properties`). Previously, arbitrary file names were silently accepted and ignored ([#1027]). -- Bump `stackable-operator` to 0.110.1 ([#1027]). +- Bump `stackable-operator` to 0.111.1 ([#1027], [#1028]). [#1020]: https://github.com/stackabletech/zookeeper-operator/pull/1020 [#1027]: https://github.com/stackabletech/zookeeper-operator/pull/1027 +[#1028]: https://github.com/stackabletech/zookeeper-operator/pull/1028 ## [26.3.0] - 2026-03-16 From 801c89487355ea2628748f890903fe048fab2163 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 30 Apr 2026 08:46:15 +0200 Subject: [PATCH 4/4] test: Add CRD roundtrip test data --- rust/operator-binary/src/crd/mod.rs | 51 +++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 90179fc3..2b844377 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -934,13 +934,60 @@ mod tests { impl RoundtripTestData for v1alpha1::ZookeeperClusterSpec { fn roundtrip_test_data() -> Vec { - vec![] + stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#" + - image: + productVersion: 1.2.3 + pullPolicy: IfNotPresent + clusterOperation: + reconciliationPaused: false + stopped: true + clusterConfig: + authentication: + - authenticationClass: my-auth-class + tls: + quorumSecretClass: null + serverSecretClass: tls + vectorAggregatorConfigMapName: vector-aggregator-discovery + servers: + envOverrides: + COMMON_VAR: role-value + ROLE_VAR: role-value + config: + logging: + enableVectorAgent: true + requestedSecretLifetime: 7d + gracefulShutdownTimeout: 30s + initLimit: 5 + syncLimit: 2 + tickTime: 2000 + myidOffset: 1 + configOverrides: + zoo.cfg: + maxClientCnxns: "60" + roleConfig: + listenerClass: cluster-internal + roleGroups: + default: + replicas: 1 + configOverrides: + zoo.cfg: + maxClientCnxns: "120" + envOverrides: + COMMON_VAR: group-value + GROUP_VAR: group-value + "#}) + .expect("Failed to parse ZookeeperClusterSpec YAML") } } impl RoundtripTestData for v1alpha1::ZookeeperZnodeSpec { fn roundtrip_test_data() -> Vec { - vec![] + stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {" + - clusterRef: + name: test-zk + namespace: default + "}) + .expect("Failed to parse ZookeeperZnodeSpec YAML") } } }