From f7439af05c7a64f0a02746e5aa323ebd30d3e410 Mon Sep 17 00:00:00 2001 From: xeniape Date: Fri, 7 Feb 2025 11:48:43 +0100 Subject: [PATCH 01/11] move crate to module --- Cargo.lock | 15 +--- Cargo.nix | 75 ++++--------------- Cargo.toml | 2 +- rust/crd/Cargo.toml | 20 ----- rust/operator-binary/Cargo.toml | 3 +- rust/operator-binary/src/command.rs | 2 +- .../src/crd}/affinity.rs | 4 +- .../src/crd}/authentication.rs | 2 +- .../lib.rs => operator-binary/src/crd/mod.rs} | 9 ++- .../src/crd}/security.rs | 4 +- .../src => operator-binary/src/crd}/tls.rs | 0 rust/operator-binary/src/discovery.rs | 12 +-- rust/operator-binary/src/main.rs | 3 +- .../src/operations/graceful_shutdown.rs | 3 +- rust/operator-binary/src/operations/pdb.rs | 6 +- rust/operator-binary/src/product_logging.rs | 7 +- rust/operator-binary/src/zk_controller.rs | 34 +++------ rust/operator-binary/src/znode_controller.rs | 12 ++- 18 files changed, 67 insertions(+), 146 deletions(-) delete mode 100644 rust/crd/Cargo.toml rename rust/{crd/src => operator-binary/src/crd}/affinity.rs (97%) rename rust/{crd/src => operator-binary/src/crd}/authentication.rs (99%) rename rust/{crd/src/lib.rs => operator-binary/src/crd/mod.rs} (99%) rename rust/{crd/src => operator-binary/src/crd}/security.rs (99%) rename rust/{crd/src => operator-binary/src/crd}/tls.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 34e48bd6..81bf066e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2330,19 +2330,6 @@ dependencies = [ "snafu 0.8.5", ] -[[package]] -name = "stackable-zookeeper-crd" -version = "0.0.0-dev" -dependencies = [ - "serde", - "serde_json", - "serde_yaml", - "snafu 0.8.5", - "stackable-operator", - "strum", - "tracing", -] - [[package]] name = "stackable-zookeeper-operator" version = "0.0.0-dev" @@ -2358,10 +2345,10 @@ dependencies = [ "product-config", "semver", "serde", + "serde_json", "serde_yaml", "snafu 0.8.5", "stackable-operator", - "stackable-zookeeper-crd", "strum", "tokio", "tokio-zookeeper", diff --git a/Cargo.nix b/Cargo.nix index 2563ae89..2f5607d7 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -32,21 +32,23 @@ rec { # "public" attributes that we attempt to keep stable with new versions of crate2nix. # + rootCrate = rec { + packageId = "stackable-zookeeper-operator"; + # Use this attribute to refer to the derivation building your root crate package. + # You can override the features with rootCrate.build.override { features = [ "default" "feature1" ... ]; }. + build = internal.buildRustCrateWithFeatures { + inherit packageId; + }; + + # Debug support which might change between releases. + # File a bug if you depend on any for non-debug work! + debug = internal.debugCrate { inherit packageId; }; + }; # Refer your crate build derivation by name here. # You can override the features with # workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }. workspaceMembers = { - "stackable-zookeeper-crd" = rec { - packageId = "stackable-zookeeper-crd"; - build = internal.buildRustCrateWithFeatures { - packageId = "stackable-zookeeper-crd"; - }; - - # Debug support which might change between releases. - # File a bug if you depend on any for non-debug work! - debug = internal.debugCrate { inherit packageId; }; - }; "stackable-zookeeper-operator" = rec { packageId = "stackable-zookeeper-operator"; build = internal.buildRustCrateWithFeatures { @@ -7304,51 +7306,6 @@ rec { } ]; - }; - "stackable-zookeeper-crd" = rec { - crateName = "stackable-zookeeper-crd"; - version = "0.0.0-dev"; - edition = "2021"; - src = lib.cleanSourceWith { filter = sourceFilter; src = ./rust/crd; }; - libName = "stackable_zookeeper_crd"; - authors = [ - "Stackable GmbH " - ]; - dependencies = [ - { - name = "serde"; - packageId = "serde"; - features = [ "derive" ]; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "snafu"; - packageId = "snafu 0.8.5"; - } - { - name = "stackable-operator"; - packageId = "stackable-operator"; - } - { - name = "strum"; - packageId = "strum"; - features = [ "derive" ]; - } - { - name = "tracing"; - packageId = "tracing"; - } - ]; - devDependencies = [ - { - name = "serde_yaml"; - packageId = "serde_yaml"; - } - ]; - }; "stackable-zookeeper-operator" = rec { crateName = "stackable-zookeeper-operator"; @@ -7408,6 +7365,10 @@ rec { packageId = "serde"; features = [ "derive" ]; } + { + name = "serde_json"; + packageId = "serde_json"; + } { name = "snafu"; packageId = "snafu 0.8.5"; @@ -7416,10 +7377,6 @@ rec { name = "stackable-operator"; packageId = "stackable-operator"; } - { - name = "stackable-zookeeper-crd"; - packageId = "stackable-zookeeper-crd"; - } { name = "strum"; packageId = "strum"; diff --git a/Cargo.toml b/Cargo.toml index a26d2810..a1123e38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["rust/crd", "rust/operator-binary"] +members = ["rust/operator-binary"] resolver = "2" [workspace.package] diff --git a/rust/crd/Cargo.toml b/rust/crd/Cargo.toml deleted file mode 100644 index a39cd89e..00000000 --- a/rust/crd/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "stackable-zookeeper-crd" -description = "Contains the Apache ZooKeeper CRD structs and utilities" -version.workspace = true -authors.workspace = true -license.workspace = true -edition.workspace = true -repository.workspace = true -publish = false - -[dependencies] -serde.workspace = true -serde_json.workspace = true -snafu.workspace = true -stackable-operator.workspace = true -strum.workspace = true -tracing.workspace = true - -[dev-dependencies] -serde_yaml.workspace = true diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index d8c85ee5..76c90ec1 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -10,8 +10,6 @@ publish = false build = "build.rs" [dependencies] -stackable-zookeeper-crd = { path = "../crd" } - anyhow.workspace = true clap.workspace = true const_format.workspace = true @@ -22,6 +20,7 @@ pin-project.workspace = true product-config.workspace = true semver.workspace = true serde.workspace = true +serde_json.workspace = true snafu.workspace = true stackable-operator.workspace = true strum.workspace = true diff --git a/rust/operator-binary/src/command.rs b/rust/operator-binary/src/command.rs index 09c871f6..00110df2 100644 --- a/rust/operator-binary/src/command.rs +++ b/rust/operator-binary/src/command.rs @@ -1,4 +1,4 @@ -use stackable_zookeeper_crd::{STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_RW_CONFIG_DIR}; +use crate::crd::{STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_RW_CONFIG_DIR}; pub fn create_init_container_command_args() -> Vec { vec![ diff --git a/rust/crd/src/affinity.rs b/rust/operator-binary/src/crd/affinity.rs similarity index 97% rename from rust/crd/src/affinity.rs rename to rust/operator-binary/src/crd/affinity.rs index 1c653d71..c4d6e7a2 100644 --- a/rust/crd/src/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -3,7 +3,7 @@ use stackable_operator::{ k8s_openapi::api::core::v1::PodAntiAffinity, }; -use crate::{ZookeeperRole, APP_NAME}; +use crate::crd::{ZookeeperRole, APP_NAME}; pub fn get_affinity(cluster_name: &str, role: &ZookeeperRole) -> StackableAffinityFragment { let affinity_between_role_pods = @@ -37,7 +37,7 @@ mod tests { role_utils::RoleGroupRef, }; - use crate::{ZookeeperCluster, ZookeeperRole}; + use crate::{crd::affinity::ZookeeperRole, ZookeeperCluster}; #[test] fn test_affinity_defaults() { diff --git a/rust/crd/src/authentication.rs b/rust/operator-binary/src/crd/authentication.rs similarity index 99% rename from rust/crd/src/authentication.rs rename to rust/operator-binary/src/crd/authentication.rs index e96c66b1..0af304eb 100644 --- a/rust/crd/src/authentication.rs +++ b/rust/operator-binary/src/crd/authentication.rs @@ -6,7 +6,7 @@ use stackable_operator::{ schemars::{self, JsonSchema}, }; -use crate::ObjectRef; +use crate::crd::ObjectRef; const SUPPORTED_AUTHENTICATION_CLASS: [&str; 1] = ["TLS"]; diff --git a/rust/crd/src/lib.rs b/rust/operator-binary/src/crd/mod.rs similarity index 99% rename from rust/crd/src/lib.rs rename to rust/operator-binary/src/crd/mod.rs index c87c6342..3680b223 100644 --- a/rust/crd/src/lib.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -35,7 +35,9 @@ use stackable_operator::{ }; use strum::{Display, EnumIter, EnumString, IntoEnumIterator}; -use crate::{affinity::get_affinity, authentication::ZookeeperAuthentication, tls::ZookeeperTls}; +use crate::crd::{ + affinity::get_affinity, authentication::ZookeeperAuthentication, tls::ZookeeperTls, +}; pub mod affinity; pub mod authentication; @@ -471,7 +473,10 @@ impl ZookeeperCluster { let version = self .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::CARGO_PKG_VERSION) + .resolve( + DOCKER_IMAGE_BASE_NAME, + crate::crd::built_info::CARGO_PKG_VERSION, + ) .product_version; let zookeeper_versions_with_log4j = [ "1.", "2.", "3.0.", "3.1.", "3.2.", "3.3.", "3.4.", "3.5.", "3.6.", "3.7.", diff --git a/rust/crd/src/security.rs b/rust/operator-binary/src/crd/security.rs similarity index 99% rename from rust/crd/src/security.rs rename to rust/operator-binary/src/crd/security.rs index 88752135..477b4b0e 100644 --- a/rust/crd/src/security.rs +++ b/rust/operator-binary/src/crd/security.rs @@ -25,7 +25,9 @@ use stackable_operator::{ time::Duration, }; -use crate::{authentication, authentication::ResolvedAuthenticationClasses, tls, ZookeeperCluster}; +use crate::crd::{ + authentication, authentication::ResolvedAuthenticationClasses, tls, ZookeeperCluster, +}; type Result = std::result::Result; diff --git a/rust/crd/src/tls.rs b/rust/operator-binary/src/crd/tls.rs similarity index 100% rename from rust/crd/src/tls.rs rename to rust/operator-binary/src/crd/tls.rs diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index 14671b66..a797fba5 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -8,9 +8,11 @@ use stackable_operator::{ kube::{runtime::reflector::ObjectRef, Resource, ResourceExt}, utils::cluster_info::KubernetesClusterInfo, }; -use stackable_zookeeper_crd::{security::ZookeeperSecurity, ZookeeperCluster, ZookeeperRole}; -use crate::utils::build_recommended_labels; +use crate::{ + crd::{security::ZookeeperSecurity, ZookeeperCluster, ZookeeperRole}, + utils::build_recommended_labels, +}; type Result = std::result::Result; @@ -32,9 +34,7 @@ pub enum Error { NoNamespace, #[snafu(display("failed to list expected pods"))] - ExpectedPods { - source: stackable_zookeeper_crd::Error, - }, + ExpectedPods { source: crate::crd::Error }, #[snafu(display("could not find service port with name {}", port_name))] NoServicePort { port_name: String }, @@ -89,7 +89,7 @@ pub async fn build_discovery_configmaps( resolved_product_image, )?]; if zk.spec.cluster_config.listener_class - == stackable_zookeeper_crd::CurrentlySupportedListenerClasses::ExternalUnstable + == crate::crd::CurrentlySupportedListenerClasses::ExternalUnstable { discovery_configmaps.push(build_discovery_configmap( zk, diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 57d59559..21f90163 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,6 +1,7 @@ use std::sync::Arc; use clap::{crate_description, crate_version, Parser}; +use crd::{ZookeeperCluster, ZookeeperZnode, APP_NAME, OPERATOR_NAME}; use futures::{pin_mut, StreamExt}; use stackable_operator::{ cli::{Command, ProductOperatorRun}, @@ -20,11 +21,11 @@ use stackable_operator::{ logging::controller::report_controller_reconciled, CustomResourceExt, }; -use stackable_zookeeper_crd::{ZookeeperCluster, ZookeeperZnode, APP_NAME, OPERATOR_NAME}; use crate::{zk_controller::ZK_FULL_CONTROLLER_NAME, znode_controller::ZNODE_FULL_CONTROLLER_NAME}; mod command; +pub mod crd; mod discovery; mod operations; mod product_logging; diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index cdbac3e9..af871600 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -1,6 +1,7 @@ use snafu::{ResultExt, Snafu}; use stackable_operator::builder::pod::PodBuilder; -use stackable_zookeeper_crd::ZookeeperConfig; + +use crate::crd::ZookeeperConfig; #[derive(Debug, Snafu)] pub enum Error { diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index e2ca47cb..8f03e897 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -3,9 +3,11 @@ use stackable_operator::{ builder::pdb::PodDisruptionBudgetBuilder, client::Client, cluster_resources::ClusterResources, commons::pdb::PdbConfig, kube::ResourceExt, }; -use stackable_zookeeper_crd::{ZookeeperCluster, ZookeeperRole, APP_NAME, OPERATOR_NAME}; -use crate::zk_controller::ZK_CONTROLLER_NAME; +use crate::{ + crd::{ZookeeperCluster, ZookeeperRole, APP_NAME, OPERATOR_NAME}, + zk_controller::ZK_CONTROLLER_NAME, +}; #[derive(Snafu, Debug)] pub enum Error { diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index 03cce7ac..d2a79453 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -11,7 +11,8 @@ use stackable_operator::{ }, role_utils::RoleGroupRef, }; -use stackable_zookeeper_crd::{ + +use crate::crd::{ Container, LoggingFramework, ZookeeperCluster, ZookeeperRole, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, }; @@ -34,9 +35,7 @@ pub enum Error { }, #[snafu(display("crd validation failure"))] - CrdValidationFailure { - source: stackable_zookeeper_crd::Error, - }, + CrdValidationFailure { source: crate::crd::Error }, #[snafu(display("vectorAggregatorConfigMapName must be set"))] MissingVectorAggregatorAddress, diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 63966cbd..45fb9441 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -64,17 +64,17 @@ use stackable_operator::{ time::Duration, utils::{cluster_info::KubernetesClusterInfo, COMMON_BASH_TRAP_FUNCTIONS}, }; -use stackable_zookeeper_crd::{ - security::{self, ZookeeperSecurity}, - Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig, ZookeeperRole, - DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, MAX_PREPARE_LOG_FILE_SIZE, - MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, - STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, -}; use strum::{EnumDiscriminants, IntoStaticStr}; use crate::{ command::create_init_container_command_args, + crd::{ + security::{self, ZookeeperSecurity}, + Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig, ZookeeperRole, + DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, MAX_PREPARE_LOG_FILE_SIZE, + MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, + STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, + }, discovery::{self, build_discovery_configmaps}, operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs}, product_logging::{extend_role_group_config_map, resolve_vector_aggregator_address}, @@ -106,9 +106,7 @@ pub enum Error { }, #[snafu(display("crd validation failure"))] - CrdValidationFailure { - source: stackable_zookeeper_crd::Error, - }, + CrdValidationFailure { source: crate::crd::Error }, #[snafu(display("object defines no server role"))] NoServerRole, @@ -120,9 +118,7 @@ pub enum Error { }, #[snafu(display("internal operator failure"))] - InternalOperatorFailure { - source: stackable_zookeeper_crd::Error, - }, + InternalOperatorFailure { source: crate::crd::Error }, #[snafu(display("failed to calculate global service name"))] GlobalServiceNameNotFound, @@ -196,9 +192,7 @@ pub enum Error { }, #[snafu(display("invalid java heap config"))] - InvalidJavaHeapConfig { - source: stackable_zookeeper_crd::Error, - }, + InvalidJavaHeapConfig { source: crate::crd::Error }, #[snafu(display("failed to create RBAC service account"))] ApplyServiceAccount { @@ -232,14 +226,10 @@ pub enum Error { }, #[snafu(display("failed to initialize security context"))] - FailedToInitializeSecurityContext { - source: stackable_zookeeper_crd::security::Error, - }, + FailedToInitializeSecurityContext { source: crate::crd::security::Error }, #[snafu(display("failed to resolve and merge config for role and role group"))] - FailedToResolveConfig { - source: stackable_zookeeper_crd::Error, - }, + FailedToResolveConfig { source: crate::crd::Error }, #[snafu(display("failed to create PodDisruptionBudget"))] FailedToCreatePdb { diff --git a/rust/operator-binary/src/znode_controller.rs b/rust/operator-binary/src/znode_controller.rs index eda1b8ea..fe881561 100644 --- a/rust/operator-binary/src/znode_controller.rs +++ b/rust/operator-binary/src/znode_controller.rs @@ -20,14 +20,14 @@ use stackable_operator::{ time::Duration, utils::cluster_info::KubernetesClusterInfo, }; -use stackable_zookeeper_crd::{ - security::ZookeeperSecurity, ZookeeperCluster, ZookeeperZnode, ZookeeperZnodeStatus, - DOCKER_IMAGE_BASE_NAME, -}; use strum::{EnumDiscriminants, IntoStaticStr}; use tracing::{debug, info}; use crate::{ + crd::{ + security::ZookeeperSecurity, ZookeeperCluster, ZookeeperZnode, ZookeeperZnodeStatus, + DOCKER_IMAGE_BASE_NAME, + }, discovery::{self, build_discovery_configmaps}, APP_NAME, OPERATOR_NAME, }; @@ -121,9 +121,7 @@ pub enum Error { ObjectHasNoNamespace, #[snafu(display("failed to initialize security context"))] - FailedToInitializeSecurityContext { - source: stackable_zookeeper_crd::security::Error, - }, + FailedToInitializeSecurityContext { source: crate::crd::security::Error }, } type Result = std::result::Result; From b030d92377165e224158e24a21ab95c341306da0 Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 10 Feb 2025 12:55:11 +0100 Subject: [PATCH 02/11] chore: add stackable-versioned dependency --- Cargo.lock | 298 +++++++- Cargo.nix | 1149 ++++++++++++++++++++++++++++--- Cargo.toml | 1 + crate-hashes.json | 3 + rust/operator-binary/Cargo.toml | 1 + 5 files changed, 1346 insertions(+), 106 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81bf066e..54802182 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,6 +220,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.8.0" @@ -368,6 +374,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -624,6 +639,15 @@ dependencies = [ "regex-syntax 0.8.5", ] +[[package]] +name = "fluent-uri" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "fnv" version = "1.0.7" @@ -774,7 +798,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ - "bitflags", + "bitflags 2.8.0", "libc", "libgit2-sys", "log", @@ -787,6 +811,16 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + [[package]] name = "hashbrown" version = "0.15.2" @@ -1165,7 +1199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -1195,6 +1229,15 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" @@ -1231,18 +1274,45 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json-patch" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" +dependencies = [ + "jsonptr 0.4.7", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "json-patch" version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" dependencies = [ - "jsonptr", + "jsonptr 0.6.3", "serde", "serde_json", "thiserror 1.0.69", ] +[[package]] +name = "jsonpath-rust" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d8fe85bd70ff715f31ce8c739194b423d79811a19602115d611a3ec85d6200" +dependencies = [ + "lazy_static", + "once_cell", + "pest", + "pest_derive", + "regex", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "jsonpath-rust" version = "0.7.5" @@ -1256,6 +1326,17 @@ dependencies = [ "thiserror 2.0.11", ] +[[package]] +name = "jsonptr" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +dependencies = [ + "fluent-uri", + "serde", + "serde_json", +] + [[package]] name = "jsonptr" version = "0.6.3" @@ -1266,6 +1347,20 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k8s-openapi" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8847402328d8301354c94d605481f25a6bdc1ed65471fd96af8eca71141b13" +dependencies = [ + "base64 0.22.1", + "chrono", + "schemars", + "serde", + "serde-value", + "serde_json", +] + [[package]] name = "k8s-openapi" version = "0.24.0" @@ -1280,17 +1375,78 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k8s-version" +version = "0.1.2" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#048c7d8befddc2f2c6414444006871c95412d67c" +dependencies = [ + "darling", + "regex", + "snafu 0.8.5", +] + +[[package]] +name = "kube" +version = "0.96.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efffeb3df0bd4ef3e5d65044573499c0e4889b988070b08c50b25b1329289a1f" +dependencies = [ + "k8s-openapi 0.23.0", + "kube-client 0.96.0", + "kube-core 0.96.0", + "kube-derive 0.96.0", + "kube-runtime 0.96.0", +] + [[package]] name = "kube" version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32053dc495efad4d188c7b33cc7c02ef4a6e43038115348348876efd39a53cba" dependencies = [ - "k8s-openapi", - "kube-client", - "kube-core", - "kube-derive", - "kube-runtime", + "k8s-openapi 0.24.0", + "kube-client 0.98.0", + "kube-core 0.98.0", + "kube-derive 0.98.0", + "kube-runtime 0.98.0", +] + +[[package]] +name = "kube-client" +version = "0.96.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bf471ece8ff8d24735ce78dac4d091e9fcb8d74811aeb6b75de4d1c3f5de0f1" +dependencies = [ + "base64 0.22.1", + "bytes", + "chrono", + "either", + "futures 0.3.31", + "home", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-http-proxy", + "hyper-rustls", + "hyper-timeout", + "hyper-util", + "jsonpath-rust 0.5.1", + "k8s-openapi 0.23.0", + "kube-core 0.96.0", + "pem", + "rustls", + "rustls-pemfile", + "secrecy", + "serde", + "serde_json", + "serde_yaml", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tracing", ] [[package]] @@ -1313,9 +1469,9 @@ dependencies = [ "hyper-rustls", "hyper-timeout", "hyper-util", - "jsonpath-rust", - "k8s-openapi", - "kube-core", + "jsonpath-rust 0.7.5", + "k8s-openapi 0.24.0", + "kube-core 0.98.0", "pem", "rustls", "rustls-pemfile", @@ -1331,6 +1487,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "kube-core" +version = "0.96.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f42346d30bb34d1d7adc5c549b691bce7aa3a1e60254e68fab7e2d7b26fe3d77" +dependencies = [ + "chrono", + "form_urlencoded", + "http", + "json-patch 2.0.0", + "k8s-openapi 0.23.0", + "schemars", + "serde", + "serde-value", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "kube-core" version = "0.98.0" @@ -1340,8 +1514,8 @@ dependencies = [ "chrono", "form_urlencoded", "http", - "json-patch", - "k8s-openapi", + "json-patch 3.0.1", + "k8s-openapi 0.24.0", "schemars", "serde", "serde-value", @@ -1349,6 +1523,19 @@ dependencies = [ "thiserror 2.0.11", ] +[[package]] +name = "kube-derive" +version = "0.96.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9364e04cc5e0482136c6ee8b7fb7551812da25802249f35b3def7aaa31e82ad" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.96", +] + [[package]] name = "kube-derive" version = "0.98.0" @@ -1362,6 +1549,34 @@ dependencies = [ "syn 2.0.96", ] +[[package]] +name = "kube-runtime" +version = "0.96.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fbf1f6ffa98e65f1d2a9a69338bb60605d46be7edf00237784b89e62c9bd44" +dependencies = [ + "ahash", + "async-broadcast", + "async-stream", + "async-trait", + "backoff", + "educe", + "futures 0.3.31", + "hashbrown 0.14.5", + "json-patch 2.0.0", + "jsonptr 0.4.7", + "k8s-openapi 0.23.0", + "kube-client 0.96.0", + "parking_lot", + "pin-project", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "kube-runtime" version = "0.98.0" @@ -1375,12 +1590,12 @@ dependencies = [ "backoff", "educe", "futures 0.3.31", - "hashbrown", + "hashbrown 0.15.2", "hostname", - "json-patch", - "jsonptr", - "k8s-openapi", - "kube-client", + "json-patch 3.0.1", + "jsonptr 0.6.3", + "k8s-openapi 0.24.0", + "kube-client 0.98.0", "parking_lot", "pin-project", "serde", @@ -1841,7 +2056,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags", + "bitflags 2.8.0", ] [[package]] @@ -2042,7 +2257,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags", + "bitflags 2.8.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -2055,7 +2270,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags", + "bitflags 2.8.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -2283,9 +2498,9 @@ dependencies = [ "either", "futures 0.3.31", "indexmap", - "json-patch", - "k8s-openapi", - "kube", + "json-patch 3.0.1", + "k8s-openapi 0.24.0", + "kube 0.98.0", "opentelemetry-jaeger", "opentelemetry_sdk", "product-config", @@ -2323,13 +2538,37 @@ name = "stackable-shared" version = "0.0.1" source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#59506c6202778889a27b6ae8153457e60a49c68d" dependencies = [ - "kube", + "kube 0.98.0", "semver", "serde", "serde_yaml", "snafu 0.8.5", ] +[[package]] +name = "stackable-versioned" +version = "0.5.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#048c7d8befddc2f2c6414444006871c95412d67c" +dependencies = [ + "stackable-versioned-macros", +] + +[[package]] +name = "stackable-versioned-macros" +version = "0.5.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#048c7d8befddc2f2c6414444006871c95412d67c" +dependencies = [ + "convert_case", + "darling", + "itertools", + "k8s-openapi 0.23.0", + "k8s-version", + "kube 0.96.0", + "proc-macro2", + "quote", + "syn 2.0.96", +] + [[package]] name = "stackable-zookeeper-operator" version = "0.0.0-dev" @@ -2349,6 +2588,7 @@ dependencies = [ "serde_yaml", "snafu 0.8.5", "stackable-operator", + "stackable-versioned", "strum", "tokio", "tokio-zookeeper", @@ -2645,7 +2885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "base64 0.22.1", - "bitflags", + "bitflags 2.8.0", "bytes", "http", "http-body", @@ -2797,6 +3037,12 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + [[package]] name = "unicode-xid" version = "0.2.6" diff --git a/Cargo.nix b/Cargo.nix index 2f5607d7..411b813d 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -657,7 +657,22 @@ rec { }; resolvedDefaultFeatures = [ "std" ]; }; - "bitflags" = rec { + "bitflags 1.3.2" = rec { + crateName = "bitflags"; + version = "1.3.2"; + edition = "2018"; + sha256 = "12ki6w8gn1ldq7yz9y680llwk5gmrhrzszaa17g1sbrw2r2qvwxy"; + authors = [ + "The Rust Project Developers" + ]; + features = { + "compiler_builtins" = [ "dep:compiler_builtins" ]; + "core" = [ "dep:core" ]; + "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; + }; + resolvedDefaultFeatures = [ "default" ]; + }; + "bitflags 2.8.0" = rec { crateName = "bitflags"; version = "2.8.0"; edition = "2021"; @@ -1088,6 +1103,25 @@ rec { }; resolvedDefaultFeatures = [ "default" ]; }; + "convert_case" = rec { + crateName = "convert_case"; + version = "0.6.0"; + edition = "2018"; + sha256 = "1jn1pq6fp3rri88zyw6jlhwwgf6qiyc08d6gjv0qypgkl862n67c"; + authors = [ + "Rutrum " + ]; + dependencies = [ + { + name = "unicode-segmentation"; + packageId = "unicode-segmentation"; + } + ]; + features = { + "rand" = [ "dep:rand" ]; + "random" = [ "rand" ]; + }; + }; "core-foundation 0.10.0" = rec { crateName = "core-foundation"; version = "0.10.0"; @@ -1769,6 +1803,26 @@ rec { }; resolvedDefaultFeatures = [ "default" "perf" "std" "unicode" ]; }; + "fluent-uri" = rec { + crateName = "fluent-uri"; + version = "0.1.4"; + edition = "2021"; + sha256 = "03ah2qajw5l1zbc81kh1n8g7n24mfxbg6vqyv9ixipg1vglh9iqp"; + libName = "fluent_uri"; + authors = [ + "Scallop Ye " + ]; + dependencies = [ + { + name = "bitflags"; + packageId = "bitflags 1.3.2"; + } + ]; + features = { + "default" = [ "std" ]; + }; + resolvedDefaultFeatures = [ "std" ]; + }; "fnv" = rec { crateName = "fnv"; version = "1.0.7"; @@ -2207,7 +2261,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "libc"; @@ -2248,7 +2302,46 @@ rec { ]; }; - "hashbrown" = rec { + "hashbrown 0.14.5" = rec { + crateName = "hashbrown"; + version = "0.14.5"; + edition = "2021"; + sha256 = "1wa1vy1xs3mp11bn3z9dv0jricgr6a2j0zkf1g19yz3vw4il89z5"; + authors = [ + "Amanieu d'Antras " + ]; + dependencies = [ + { + name = "ahash"; + packageId = "ahash"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "allocator-api2"; + packageId = "allocator-api2"; + optional = true; + usesDefaultFeatures = false; + features = [ "alloc" ]; + } + ]; + features = { + "ahash" = [ "dep:ahash" ]; + "alloc" = [ "dep:alloc" ]; + "allocator-api2" = [ "dep:allocator-api2" ]; + "compiler_builtins" = [ "dep:compiler_builtins" ]; + "core" = [ "dep:core" ]; + "default" = [ "ahash" "inline-more" "allocator-api2" ]; + "equivalent" = [ "dep:equivalent" ]; + "nightly" = [ "allocator-api2?/nightly" "bumpalo/allocator_api" ]; + "rayon" = [ "dep:rayon" ]; + "rkyv" = [ "dep:rkyv" ]; + "rustc-dep-of-std" = [ "nightly" "core" "compiler_builtins" "alloc" "rustc-internal-api" ]; + "serde" = [ "dep:serde" ]; + }; + resolvedDefaultFeatures = [ "ahash" "allocator-api2" "default" "inline-more" ]; + }; + "hashbrown 0.15.2" = rec { crateName = "hashbrown"; version = "0.15.2"; edition = "2021"; @@ -3518,7 +3611,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown"; + packageId = "hashbrown 0.15.2"; usesDefaultFeatures = false; } ]; @@ -3592,6 +3685,27 @@ rec { }; resolvedDefaultFeatures = [ "default" ]; }; + "itertools" = rec { + crateName = "itertools"; + version = "0.13.0"; + edition = "2018"; + sha256 = "11hiy3qzl643zcigknclh446qb9zlg4dpdzfkjaa9q9fqpgyfgj1"; + authors = [ + "bluss" + ]; + dependencies = [ + { + name = "either"; + packageId = "either"; + usesDefaultFeatures = false; + } + ]; + features = { + "default" = [ "use_std" ]; + "use_std" = [ "use_alloc" "either/use_std" ]; + }; + resolvedDefaultFeatures = [ "default" "use_alloc" "use_std" ]; + }; "itoa" = rec { crateName = "itoa"; version = "1.0.14"; @@ -3673,7 +3787,48 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "json-patch" = rec { + "json-patch 2.0.0" = rec { + crateName = "json-patch"; + version = "2.0.0"; + edition = "2021"; + sha256 = "1z1h6dyy4lx4z74yby2hvgl4jbm8mh5ymjp6fwcdkyi3923bh7sv"; + libName = "json_patch"; + authors = [ + "Ivan Dubrov " + ]; + dependencies = [ + { + name = "jsonptr"; + packageId = "jsonptr 0.4.7"; + } + { + name = "serde"; + packageId = "serde"; + features = [ "derive" ]; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "thiserror"; + packageId = "thiserror 1.0.69"; + } + ]; + devDependencies = [ + { + name = "serde_json"; + packageId = "serde_json"; + features = [ "preserve_order" ]; + } + ]; + features = { + "default" = [ "diff" ]; + "utoipa" = [ "dep:utoipa" ]; + }; + resolvedDefaultFeatures = [ "default" "diff" ]; + }; + "json-patch 3.0.1" = rec { crateName = "json-patch"; version = "3.0.1"; edition = "2021"; @@ -3685,7 +3840,7 @@ rec { dependencies = [ { name = "jsonptr"; - packageId = "jsonptr"; + packageId = "jsonptr 0.6.3"; } { name = "serde"; @@ -3714,7 +3869,48 @@ rec { }; resolvedDefaultFeatures = [ "default" "diff" ]; }; - "jsonpath-rust" = rec { + "jsonpath-rust 0.5.1" = rec { + crateName = "jsonpath-rust"; + version = "0.5.1"; + edition = "2018"; + sha256 = "0032bp43w6k1bl8h55m126cdf8xljj8p736f65gp3zvhpn2zxn0r"; + libName = "jsonpath_rust"; + authors = [ + "BorisZhguchev " + ]; + dependencies = [ + { + name = "lazy_static"; + packageId = "lazy_static"; + } + { + name = "once_cell"; + packageId = "once_cell"; + } + { + name = "pest"; + packageId = "pest"; + } + { + name = "pest_derive"; + packageId = "pest_derive"; + } + { + name = "regex"; + packageId = "regex"; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "thiserror"; + packageId = "thiserror 1.0.69"; + } + ]; + + }; + "jsonpath-rust 0.7.5" = rec { crateName = "jsonpath-rust"; version = "0.7.5"; edition = "2021"; @@ -3747,7 +3943,44 @@ rec { ]; }; - "jsonptr" = rec { + "jsonptr 0.4.7" = rec { + crateName = "jsonptr"; + version = "0.4.7"; + edition = "2021"; + sha256 = "09s6bqjlkd1m5z9hi9iwjimiri7wx3fd6d88hara0p27968m4vhw"; + authors = [ + "chance dinkins" + ]; + dependencies = [ + { + name = "fluent-uri"; + packageId = "fluent-uri"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "serde"; + packageId = "serde"; + usesDefaultFeatures = false; + features = [ "alloc" ]; + } + { + name = "serde_json"; + packageId = "serde_json"; + usesDefaultFeatures = false; + features = [ "alloc" ]; + } + ]; + features = { + "default" = [ "std" ]; + "fluent-uri" = [ "dep:fluent-uri" ]; + "std" = [ "serde/std" "serde_json/std" "fluent-uri?/std" ]; + "uniresid" = [ "dep:uniresid" ]; + "url" = [ "dep:url" ]; + }; + resolvedDefaultFeatures = [ "default" "std" ]; + }; + "jsonptr 0.6.3" = rec { crateName = "jsonptr"; version = "0.6.3"; edition = "2021"; @@ -3781,12 +4014,12 @@ rec { }; resolvedDefaultFeatures = [ "assign" "default" "delete" "json" "resolve" "serde" "std" ]; }; - "k8s-openapi" = rec { + "k8s-openapi 0.23.0" = rec { crateName = "k8s-openapi"; - version = "0.24.0"; + version = "0.23.0"; edition = "2021"; - links = "k8s-openapi-0.24.0"; - sha256 = "1m8ahw59g44kp9p4yd4ar0px15m2nyvhc5krbvqvw2ag6a8bjx9c"; + links = "k8s-openapi-0.23.0"; + sha256 = "04qv2iqwm3mgjvyp2m6n3vf6nnpjh5a60kf9ah9k1n184d04g24w"; libName = "k8s_openapi"; authors = [ "Arnav Singh " @@ -3828,72 +4061,159 @@ rec { } ]; features = { - "earliest" = [ "v1_28" ]; - "latest" = [ "v1_32" ]; + "earliest" = [ "v1_26" ]; + "latest" = [ "v1_31" ]; "schemars" = [ "dep:schemars" ]; }; - resolvedDefaultFeatures = [ "schemars" "v1_32" ]; + resolvedDefaultFeatures = [ "schemars" "v1_31" ]; }; - "kube" = rec { - crateName = "kube"; - version = "0.98.0"; + "k8s-openapi 0.24.0" = rec { + crateName = "k8s-openapi"; + version = "0.24.0"; edition = "2021"; - sha256 = "1fiwllwzsvl7921k85c10d1nwjpg09ycqcvvihc4vbggjp23s19j"; + links = "k8s-openapi-0.24.0"; + sha256 = "1m8ahw59g44kp9p4yd4ar0px15m2nyvhc5krbvqvw2ag6a8bjx9c"; + libName = "k8s_openapi"; authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " + "Arnav Singh " ]; dependencies = [ { - name = "k8s-openapi"; - packageId = "k8s-openapi"; + name = "base64"; + packageId = "base64 0.22.1"; usesDefaultFeatures = false; + features = [ "alloc" ]; } { - name = "kube-client"; - packageId = "kube-client"; - optional = true; + name = "chrono"; + packageId = "chrono"; usesDefaultFeatures = false; + features = [ "alloc" "serde" ]; } { - name = "kube-core"; - packageId = "kube-core"; + name = "schemars"; + packageId = "schemars"; + optional = true; + usesDefaultFeatures = false; } { - name = "kube-derive"; - packageId = "kube-derive"; - optional = true; + name = "serde"; + packageId = "serde"; + usesDefaultFeatures = false; } { - name = "kube-runtime"; - packageId = "kube-runtime"; - optional = true; + name = "serde-value"; + packageId = "serde-value"; + usesDefaultFeatures = false; } - ]; - devDependencies = [ { - name = "k8s-openapi"; - packageId = "k8s-openapi"; + name = "serde_json"; + packageId = "serde_json"; usesDefaultFeatures = false; - features = [ "latest" ]; + features = [ "alloc" ]; } ]; features = { - "admission" = [ "kube-core/admission" ]; - "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; - "client" = [ "kube-client/client" "config" ]; - "config" = [ "kube-client/config" ]; - "default" = [ "client" "rustls-tls" ]; - "derive" = [ "kube-derive" "kube-core/schema" ]; - "gzip" = [ "kube-client/gzip" "client" ]; - "http-proxy" = [ "kube-client/http-proxy" "client" ]; - "jsonpatch" = [ "kube-core/jsonpatch" ]; - "kube-client" = [ "dep:kube-client" ]; - "kube-derive" = [ "dep:kube-derive" ]; - "kube-runtime" = [ "dep:kube-runtime" ]; - "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; - "oauth" = [ "kube-client/oauth" "client" ]; + "earliest" = [ "v1_28" ]; + "latest" = [ "v1_32" ]; + "schemars" = [ "dep:schemars" ]; + }; + resolvedDefaultFeatures = [ "schemars" "v1_32" ]; + }; + "k8s-version" = rec { + crateName = "k8s-version"; + version = "0.1.2"; + edition = "2021"; + workspace_member = null; + src = pkgs.fetchgit { + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "048c7d8befddc2f2c6414444006871c95412d67c"; + sha256 = "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6"; + }; + libName = "k8s_version"; + authors = [ + "Stackable GmbH " + ]; + dependencies = [ + { + name = "darling"; + packageId = "darling"; + optional = true; + } + { + name = "regex"; + packageId = "regex"; + } + { + name = "snafu"; + packageId = "snafu 0.8.5"; + } + ]; + features = { + "darling" = [ "dep:darling" ]; + }; + resolvedDefaultFeatures = [ "darling" ]; + }; + "kube 0.96.0" = rec { + crateName = "kube"; + version = "0.96.0"; + edition = "2021"; + sha256 = "07ws50li6nxja26b0w40k2dqir60k4s5fi2hsvjz6kmxy0yypzzg"; + authors = [ + "clux " + "Natalie Klestrup Röijezon " + "kazk " + ]; + dependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + } + { + name = "kube-client"; + packageId = "kube-client 0.96.0"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "kube-core"; + packageId = "kube-core 0.96.0"; + } + { + name = "kube-derive"; + packageId = "kube-derive 0.96.0"; + optional = true; + } + { + name = "kube-runtime"; + packageId = "kube-runtime 0.96.0"; + optional = true; + } + ]; + devDependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + features = [ "latest" ]; + } + ]; + features = { + "admission" = [ "kube-core/admission" ]; + "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; + "client" = [ "kube-client/client" "config" ]; + "config" = [ "kube-client/config" ]; + "default" = [ "client" "rustls-tls" ]; + "derive" = [ "kube-derive" "kube-core/schema" ]; + "gzip" = [ "kube-client/gzip" "client" ]; + "http-proxy" = [ "kube-client/http-proxy" "client" ]; + "jsonpatch" = [ "kube-core/jsonpatch" ]; + "kube-client" = [ "dep:kube-client" ]; + "kube-derive" = [ "dep:kube-derive" ]; + "kube-runtime" = [ "dep:kube-runtime" ]; + "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; + "oauth" = [ "kube-client/oauth" "client" ]; "oidc" = [ "kube-client/oidc" "client" ]; "openssl-tls" = [ "kube-client/openssl-tls" "client" ]; "runtime" = [ "kube-runtime" ]; @@ -3906,7 +4226,321 @@ rec { }; resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; }; - "kube-client" = rec { + "kube 0.98.0" = rec { + crateName = "kube"; + version = "0.98.0"; + edition = "2021"; + sha256 = "1fiwllwzsvl7921k85c10d1nwjpg09ycqcvvihc4vbggjp23s19j"; + authors = [ + "clux " + "Natalie Klestrup Röijezon " + "kazk " + ]; + dependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; + usesDefaultFeatures = false; + } + { + name = "kube-client"; + packageId = "kube-client 0.98.0"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "kube-core"; + packageId = "kube-core 0.98.0"; + } + { + name = "kube-derive"; + packageId = "kube-derive 0.98.0"; + optional = true; + } + { + name = "kube-runtime"; + packageId = "kube-runtime 0.98.0"; + optional = true; + } + ]; + devDependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; + usesDefaultFeatures = false; + features = [ "latest" ]; + } + ]; + features = { + "admission" = [ "kube-core/admission" ]; + "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; + "client" = [ "kube-client/client" "config" ]; + "config" = [ "kube-client/config" ]; + "default" = [ "client" "rustls-tls" ]; + "derive" = [ "kube-derive" "kube-core/schema" ]; + "gzip" = [ "kube-client/gzip" "client" ]; + "http-proxy" = [ "kube-client/http-proxy" "client" ]; + "jsonpatch" = [ "kube-core/jsonpatch" ]; + "kube-client" = [ "dep:kube-client" ]; + "kube-derive" = [ "dep:kube-derive" ]; + "kube-runtime" = [ "dep:kube-runtime" ]; + "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; + "oauth" = [ "kube-client/oauth" "client" ]; + "oidc" = [ "kube-client/oidc" "client" ]; + "openssl-tls" = [ "kube-client/openssl-tls" "client" ]; + "runtime" = [ "kube-runtime" ]; + "rustls-tls" = [ "kube-client/rustls-tls" "client" ]; + "socks5" = [ "kube-client/socks5" "client" ]; + "unstable-client" = [ "kube-client/unstable-client" "client" ]; + "unstable-runtime" = [ "kube-runtime/unstable-runtime" "runtime" ]; + "webpki-roots" = [ "kube-client/webpki-roots" "client" ]; + "ws" = [ "kube-client/ws" "kube-core/ws" ]; + }; + resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; + }; + "kube-client 0.96.0" = rec { + crateName = "kube-client"; + version = "0.96.0"; + edition = "2021"; + sha256 = "1wg0blziqkfyfmmyn6l1fj6wp7qy156sr3g7birj93gzx3n73x4b"; + libName = "kube_client"; + authors = [ + "clux " + "Natalie Klestrup Röijezon " + "kazk " + ]; + dependencies = [ + { + name = "base64"; + packageId = "base64 0.22.1"; + optional = true; + } + { + name = "bytes"; + packageId = "bytes"; + optional = true; + } + { + name = "chrono"; + packageId = "chrono"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "either"; + packageId = "either"; + optional = true; + } + { + name = "futures"; + packageId = "futures 0.3.31"; + optional = true; + usesDefaultFeatures = false; + features = [ "std" ]; + } + { + name = "home"; + packageId = "home"; + optional = true; + } + { + name = "http"; + packageId = "http"; + } + { + name = "http-body"; + packageId = "http-body"; + optional = true; + } + { + name = "http-body-util"; + packageId = "http-body-util"; + optional = true; + } + { + name = "hyper"; + packageId = "hyper"; + optional = true; + features = [ "client" "http1" ]; + } + { + name = "hyper-http-proxy"; + packageId = "hyper-http-proxy"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "hyper-rustls"; + packageId = "hyper-rustls"; + optional = true; + usesDefaultFeatures = false; + features = [ "http1" "logging" "native-tokio" "ring" "tls12" ]; + } + { + name = "hyper-timeout"; + packageId = "hyper-timeout"; + optional = true; + } + { + name = "hyper-util"; + packageId = "hyper-util"; + optional = true; + features = [ "client" "client-legacy" "http1" "tokio" ]; + } + { + name = "jsonpath-rust"; + packageId = "jsonpath-rust 0.5.1"; + optional = true; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + } + { + name = "kube-core"; + packageId = "kube-core 0.96.0"; + } + { + name = "pem"; + packageId = "pem"; + optional = true; + } + { + name = "rustls"; + packageId = "rustls"; + optional = true; + usesDefaultFeatures = false; + } + { + name = "rustls-pemfile"; + packageId = "rustls-pemfile"; + optional = true; + } + { + name = "secrecy"; + packageId = "secrecy"; + } + { + name = "serde"; + packageId = "serde"; + features = [ "derive" ]; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "serde_yaml"; + packageId = "serde_yaml"; + optional = true; + } + { + name = "thiserror"; + packageId = "thiserror 1.0.69"; + } + { + name = "tokio"; + packageId = "tokio"; + optional = true; + features = [ "time" "signal" "sync" ]; + } + { + name = "tokio-util"; + packageId = "tokio-util"; + optional = true; + features = [ "io" "codec" ]; + } + { + name = "tower"; + packageId = "tower"; + optional = true; + features = [ "buffer" "filter" "util" ]; + } + { + name = "tower-http"; + packageId = "tower-http"; + optional = true; + features = [ "auth" "map-response-body" "trace" ]; + } + { + name = "tracing"; + packageId = "tracing"; + optional = true; + features = [ "log" ]; + } + ]; + devDependencies = [ + { + name = "futures"; + packageId = "futures 0.3.31"; + usesDefaultFeatures = false; + features = [ "async-await" ]; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + features = [ "latest" ]; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "full" ]; + } + ]; + features = { + "__non_core" = [ "tracing" "serde_yaml" "base64" ]; + "admission" = [ "kube-core/admission" ]; + "aws-lc-rs" = [ "rustls?/aws-lc-rs" ]; + "base64" = [ "dep:base64" ]; + "bytes" = [ "dep:bytes" ]; + "chrono" = [ "dep:chrono" ]; + "client" = [ "config" "__non_core" "hyper" "hyper-util" "http-body" "http-body-util" "tower" "tower-http" "hyper-timeout" "chrono" "jsonpath-rust" "bytes" "futures" "tokio" "tokio-util" "either" ]; + "config" = [ "__non_core" "pem" "home" ]; + "default" = [ "client" ]; + "either" = [ "dep:either" ]; + "form_urlencoded" = [ "dep:form_urlencoded" ]; + "futures" = [ "dep:futures" ]; + "gzip" = [ "client" "tower-http/decompression-gzip" ]; + "home" = [ "dep:home" ]; + "http-body" = [ "dep:http-body" ]; + "http-body-util" = [ "dep:http-body-util" ]; + "http-proxy" = [ "hyper-http-proxy" ]; + "hyper" = [ "dep:hyper" ]; + "hyper-http-proxy" = [ "dep:hyper-http-proxy" ]; + "hyper-openssl" = [ "dep:hyper-openssl" ]; + "hyper-rustls" = [ "dep:hyper-rustls" ]; + "hyper-socks2" = [ "dep:hyper-socks2" ]; + "hyper-timeout" = [ "dep:hyper-timeout" ]; + "hyper-util" = [ "dep:hyper-util" ]; + "jsonpatch" = [ "kube-core/jsonpatch" ]; + "jsonpath-rust" = [ "dep:jsonpath-rust" ]; + "kubelet-debug" = [ "ws" "kube-core/kubelet-debug" ]; + "oauth" = [ "client" "tame-oauth" ]; + "oidc" = [ "client" "form_urlencoded" ]; + "openssl" = [ "dep:openssl" ]; + "openssl-tls" = [ "openssl" "hyper-openssl" ]; + "pem" = [ "dep:pem" ]; + "rand" = [ "dep:rand" ]; + "rustls" = [ "dep:rustls" ]; + "rustls-pemfile" = [ "dep:rustls-pemfile" ]; + "rustls-tls" = [ "rustls" "rustls-pemfile" "hyper-rustls" "hyper-http-proxy?/rustls-tls-native-roots" ]; + "serde_yaml" = [ "dep:serde_yaml" ]; + "socks5" = [ "hyper-socks2" ]; + "tame-oauth" = [ "dep:tame-oauth" ]; + "tokio" = [ "dep:tokio" ]; + "tokio-tungstenite" = [ "dep:tokio-tungstenite" ]; + "tokio-util" = [ "dep:tokio-util" ]; + "tower" = [ "dep:tower" ]; + "tower-http" = [ "dep:tower-http" ]; + "tracing" = [ "dep:tracing" ]; + "webpki-roots" = [ "hyper-rustls/webpki-roots" ]; + "ws" = [ "client" "tokio-tungstenite" "rand" "kube-core/ws" "tokio/macros" ]; + }; + resolvedDefaultFeatures = [ "__non_core" "base64" "bytes" "chrono" "client" "config" "either" "futures" "home" "http-body" "http-body-util" "hyper" "hyper-rustls" "hyper-timeout" "hyper-util" "jsonpatch" "jsonpath-rust" "pem" "rustls" "rustls-pemfile" "rustls-tls" "serde_yaml" "tokio" "tokio-util" "tower" "tower-http" "tracing" ]; + }; + "kube-client 0.98.0" = rec { crateName = "kube-client"; version = "0.98.0"; edition = "2021"; @@ -3997,17 +4631,17 @@ rec { } { name = "jsonpath-rust"; - packageId = "jsonpath-rust"; + packageId = "jsonpath-rust 0.7.5"; optional = true; } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; } { name = "kube-core"; - packageId = "kube-core"; + packageId = "kube-core 0.98.0"; } { name = "pem"; @@ -4092,7 +4726,7 @@ rec { } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -4151,9 +4785,86 @@ rec { "webpki-roots" = [ "hyper-rustls/webpki-roots" ]; "ws" = [ "client" "tokio-tungstenite" "rand" "kube-core/ws" "tokio/macros" ]; }; - resolvedDefaultFeatures = [ "__non_core" "base64" "bytes" "chrono" "client" "config" "either" "futures" "home" "http-body" "http-body-util" "hyper" "hyper-rustls" "hyper-timeout" "hyper-util" "jsonpatch" "jsonpath-rust" "pem" "rustls" "rustls-pemfile" "rustls-tls" "serde_yaml" "tokio" "tokio-util" "tower" "tower-http" "tracing" ]; + resolvedDefaultFeatures = [ "__non_core" "base64" "bytes" "chrono" "client" "config" "either" "futures" "home" "http-body" "http-body-util" "hyper" "hyper-rustls" "hyper-timeout" "hyper-util" "jsonpatch" "jsonpath-rust" "pem" "rustls" "rustls-pemfile" "rustls-tls" "serde_yaml" "tokio" "tokio-util" "tower" "tower-http" "tracing" ]; + }; + "kube-core 0.96.0" = rec { + crateName = "kube-core"; + version = "0.96.0"; + edition = "2021"; + sha256 = "0xrxzqk7nbbymf7ycm02wshs6ynf3dlrnm2wvix1skdk1g9lc8zl"; + libName = "kube_core"; + authors = [ + "clux " + "Natalie Klestrup Röijezon " + "kazk " + ]; + dependencies = [ + { + name = "chrono"; + packageId = "chrono"; + usesDefaultFeatures = false; + features = [ "now" ]; + } + { + name = "form_urlencoded"; + packageId = "form_urlencoded"; + } + { + name = "http"; + packageId = "http"; + } + { + name = "json-patch"; + packageId = "json-patch 2.0.0"; + optional = true; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + } + { + name = "schemars"; + packageId = "schemars"; + optional = true; + } + { + name = "serde"; + packageId = "serde"; + features = [ "derive" ]; + } + { + name = "serde-value"; + packageId = "serde-value"; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "thiserror"; + packageId = "thiserror 1.0.69"; + } + ]; + devDependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + features = [ "latest" ]; + } + ]; + features = { + "admission" = [ "json-patch" ]; + "json-patch" = [ "dep:json-patch" ]; + "jsonpatch" = [ "json-patch" ]; + "kubelet-debug" = [ "ws" ]; + "schema" = [ "schemars" ]; + "schemars" = [ "dep:schemars" ]; + }; + resolvedDefaultFeatures = [ "json-patch" "jsonpatch" "schema" "schemars" ]; }; - "kube-core" = rec { + "kube-core 0.98.0" = rec { crateName = "kube-core"; version = "0.98.0"; edition = "2021"; @@ -4181,12 +4892,12 @@ rec { } { name = "json-patch"; - packageId = "json-patch"; + packageId = "json-patch 3.0.1"; optional = true; } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; } { @@ -4215,7 +4926,7 @@ rec { devDependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -4230,7 +4941,44 @@ rec { }; resolvedDefaultFeatures = [ "json-patch" "jsonpatch" "schema" "schemars" ]; }; - "kube-derive" = rec { + "kube-derive 0.96.0" = rec { + crateName = "kube-derive"; + version = "0.96.0"; + edition = "2021"; + sha256 = "1bc23sismxyyncsry902b2i2v0aifpxvgs3fdh9q412yrh24wdpr"; + procMacro = true; + libName = "kube_derive"; + authors = [ + "clux " + "Natalie Klestrup Röijezon " + "kazk " + ]; + dependencies = [ + { + name = "darling"; + packageId = "darling"; + } + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "syn"; + packageId = "syn 2.0.96"; + features = [ "extra-traits" ]; + } + ]; + + }; + "kube-derive 0.98.0" = rec { crateName = "kube-derive"; version = "0.98.0"; edition = "2021"; @@ -4267,7 +5015,130 @@ rec { ]; }; - "kube-runtime" = rec { + "kube-runtime 0.96.0" = rec { + crateName = "kube-runtime"; + version = "0.96.0"; + edition = "2021"; + sha256 = "0i5xr5i9xf44fwih1pvypr35sq30pcw979m9sbqnb3m9zzvg3yyk"; + libName = "kube_runtime"; + authors = [ + "clux " + "Natalie Klestrup Röijezon " + "kazk " + ]; + dependencies = [ + { + name = "ahash"; + packageId = "ahash"; + } + { + name = "async-broadcast"; + packageId = "async-broadcast"; + } + { + name = "async-stream"; + packageId = "async-stream"; + } + { + name = "async-trait"; + packageId = "async-trait"; + } + { + name = "backoff"; + packageId = "backoff"; + } + { + name = "educe"; + packageId = "educe"; + usesDefaultFeatures = false; + features = [ "Clone" "Debug" "Hash" "PartialEq" ]; + } + { + name = "futures"; + packageId = "futures 0.3.31"; + usesDefaultFeatures = false; + features = [ "async-await" ]; + } + { + name = "hashbrown"; + packageId = "hashbrown 0.14.5"; + } + { + name = "json-patch"; + packageId = "json-patch 2.0.0"; + } + { + name = "jsonptr"; + packageId = "jsonptr 0.4.7"; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + } + { + name = "kube-client"; + packageId = "kube-client 0.96.0"; + usesDefaultFeatures = false; + features = [ "jsonpatch" "client" ]; + } + { + name = "parking_lot"; + packageId = "parking_lot"; + } + { + name = "pin-project"; + packageId = "pin-project"; + } + { + name = "serde"; + packageId = "serde"; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "thiserror"; + packageId = "thiserror 1.0.69"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "time" ]; + } + { + name = "tokio-util"; + packageId = "tokio-util"; + features = [ "time" ]; + } + { + name = "tracing"; + packageId = "tracing"; + } + ]; + devDependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + features = [ "latest" ]; + } + { + name = "serde_json"; + packageId = "serde_json"; + } + { + name = "tokio"; + packageId = "tokio"; + features = [ "full" "test-util" ]; + } + ]; + features = { + "unstable-runtime" = [ "unstable-runtime-subscribe" "unstable-runtime-stream-control" "unstable-runtime-reconcile-on" ]; + }; + }; + "kube-runtime 0.98.0" = rec { crateName = "kube-runtime"; version = "0.98.0"; edition = "2021"; @@ -4313,7 +5184,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown"; + packageId = "hashbrown 0.15.2"; } { name = "hostname"; @@ -4321,20 +5192,20 @@ rec { } { name = "json-patch"; - packageId = "json-patch"; + packageId = "json-patch 3.0.1"; } { name = "jsonptr"; - packageId = "jsonptr"; + packageId = "jsonptr 0.6.3"; } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; } { name = "kube-client"; - packageId = "kube-client"; + packageId = "kube-client 0.98.0"; usesDefaultFeatures = false; features = [ "jsonpatch" "client" ]; } @@ -4376,7 +5247,7 @@ rec { devDependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -5736,7 +6607,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } ]; features = { @@ -6391,7 +7262,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "core-foundation"; @@ -6438,7 +7309,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "core-foundation"; @@ -7128,17 +7999,17 @@ rec { } { name = "json-patch"; - packageId = "json-patch"; + packageId = "json-patch 3.0.1"; } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; features = [ "schemars" "v1_32" ]; } { name = "kube"; - packageId = "kube"; + packageId = "kube 0.98.0"; usesDefaultFeatures = false; features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; } @@ -7283,7 +8154,7 @@ rec { dependencies = [ { name = "kube"; - packageId = "kube"; + packageId = "kube 0.98.0"; usesDefaultFeatures = false; features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; } @@ -7307,6 +8178,106 @@ rec { ]; }; + "stackable-versioned" = rec { + crateName = "stackable-versioned"; + version = "0.5.0"; + edition = "2021"; + workspace_member = null; + src = pkgs.fetchgit { + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "048c7d8befddc2f2c6414444006871c95412d67c"; + sha256 = "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6"; + }; + libName = "stackable_versioned"; + authors = [ + "Stackable GmbH " + ]; + dependencies = [ + { + name = "stackable-versioned-macros"; + packageId = "stackable-versioned-macros"; + } + ]; + features = { + "full" = [ "k8s" ]; + "k8s" = [ "stackable-versioned-macros/k8s" ]; + }; + resolvedDefaultFeatures = [ "k8s" ]; + }; + "stackable-versioned-macros" = rec { + crateName = "stackable-versioned-macros"; + version = "0.5.0"; + edition = "2021"; + workspace_member = null; + src = pkgs.fetchgit { + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "048c7d8befddc2f2c6414444006871c95412d67c"; + sha256 = "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6"; + }; + procMacro = true; + libName = "stackable_versioned_macros"; + authors = [ + "Stackable GmbH " + ]; + dependencies = [ + { + name = "convert_case"; + packageId = "convert_case"; + } + { + name = "darling"; + packageId = "darling"; + } + { + name = "itertools"; + packageId = "itertools"; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + optional = true; + usesDefaultFeatures = false; + features = [ "schemars" "v1_31" ]; + } + { + name = "k8s-version"; + packageId = "k8s-version"; + features = [ "darling" ]; + } + { + name = "kube"; + packageId = "kube 0.96.0"; + optional = true; + usesDefaultFeatures = false; + features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; + } + { + name = "proc-macro2"; + packageId = "proc-macro2"; + } + { + name = "quote"; + packageId = "quote"; + } + { + name = "syn"; + packageId = "syn 2.0.96"; + } + ]; + devDependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + features = [ "schemars" "v1_31" ]; + } + ]; + features = { + "full" = [ "k8s" ]; + "k8s" = [ "dep:kube" "dep:k8s-openapi" ]; + }; + resolvedDefaultFeatures = [ "k8s" ]; + }; "stackable-zookeeper-operator" = rec { crateName = "stackable-zookeeper-operator"; version = "0.0.0-dev"; @@ -7377,6 +8348,11 @@ rec { name = "stackable-operator"; packageId = "stackable-operator"; } + { + name = "stackable-versioned"; + packageId = "stackable-versioned"; + features = [ "k8s" ]; + } { name = "strum"; packageId = "strum"; @@ -8373,7 +9349,7 @@ rec { } { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "bytes"; @@ -8965,6 +9941,19 @@ rec { ]; }; + "unicode-segmentation" = rec { + crateName = "unicode-segmentation"; + version = "1.12.0"; + edition = "2018"; + sha256 = "14qla2jfx74yyb9ds3d2mpwpa4l4lzb9z57c6d2ba511458z5k7n"; + libName = "unicode_segmentation"; + authors = [ + "kwantam " + "Manish Goregaokar " + ]; + features = { + }; + }; "unicode-xid" = rec { crateName = "unicode-xid"; version = "0.2.6"; diff --git a/Cargo.toml b/Cargo.toml index a1123e38..1968c5c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ serde_json = "1.0" serde_yaml = "0.9" snafu = "0.8" stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" } +stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" } product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } diff --git a/crate-hashes.json b/crate-hashes.json index 290d87f2..c7d32c3a 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -2,5 +2,8 @@ "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#stackable-operator-derive@0.3.1": "0rh476rmn5850yj85hq8znwmlfhd7l5bkxz0n5i9m4cddxhi2cl5", "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#stackable-operator@0.85.0": "0rh476rmn5850yj85hq8znwmlfhd7l5bkxz0n5i9m4cddxhi2cl5", "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#stackable-shared@0.0.1": "0rh476rmn5850yj85hq8znwmlfhd7l5bkxz0n5i9m4cddxhi2cl5", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#k8s-version@0.1.2": "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#stackable-versioned-macros@0.5.0": "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#stackable-versioned@0.5.0": "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6", "git+https://github.com/stackabletech/product-config.git?tag=0.7.0#product-config@0.7.0": "0gjsm80g6r75pm3824dcyiz4ysq1ka4c1if6k1mjm9cnd5ym0gny" } \ No newline at end of file diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 76c90ec1..bb22d926 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -23,6 +23,7 @@ serde.workspace = true serde_json.workspace = true snafu.workspace = true stackable-operator.workspace = true +stackable-versioned.workspace = true strum.workspace = true tokio-zookeeper.workspace = true tokio.workspace = true From 968d6f037d948feff636e6e47e3f0c79b8f3bd32 Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 10 Feb 2025 14:14:30 +0100 Subject: [PATCH 03/11] chore: separate impls from crd data structures --- rust/operator-binary/src/crd/mod.rs | 212 ++++++++++++++-------------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 3680b223..1c3b0b94 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -203,15 +203,6 @@ pub enum CurrentlySupportedListenerClasses { ExternalUnstable, } -impl CurrentlySupportedListenerClasses { - pub fn k8s_service_type(&self) -> String { - match self { - CurrentlySupportedListenerClasses::ClusterInternal => "ClusterIP".to_string(), - CurrentlySupportedListenerClasses::ExternalUnstable => "NodePort".to_string(), - } - } -} - #[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] #[fragment_attrs( derive( @@ -290,6 +281,102 @@ pub enum Container { Zookeeper, } +#[derive( + Clone, + Debug, + Deserialize, + Display, + EnumIter, + Eq, + Hash, + JsonSchema, + PartialEq, + Serialize, + EnumString, +)] +#[strum(serialize_all = "camelCase")] +pub enum ZookeeperRole { + #[strum(serialize = "server")] + Server, +} + +#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ZookeeperClusterStatus { + /// An opaque value that changes every time a discovery detail does + #[serde(default, skip_serializing_if = "Option::is_none")] + pub discovery_hash: Option, + #[serde(default)] + pub conditions: Vec, +} + +pub enum LoggingFramework { + LOG4J, + LOGBACK, +} + +/// Reference to a single `Pod` that is a component of a [`ZookeeperCluster`] +/// +/// Used for service discovery. +pub struct ZookeeperPodRef { + pub namespace: String, + pub role_group_service_name: String, + pub pod_name: String, + pub zookeeper_myid: u16, +} + +/// A claim for a single ZooKeeper ZNode tree (filesystem node). +/// +/// A ConfigMap will automatically be created with the same name, containing the connection string in the field `ZOOKEEPER`. +/// Each ZookeeperZnode gets an isolated ZNode chroot, which the `ZOOKEEPER` automatically contains. +/// All data inside of this chroot will be deleted when the corresponding `ZookeeperZnode` is. +/// +/// `ZookeeperZnode` is *not* designed to manage the contents of this ZNode. Instead, it should be used to create a chroot +/// for an installation of an application to work inside. Initializing the contents is the responsibility of the application. +/// +/// You can learn more about this in the +/// [Isolating clients with ZNodes usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/isolating_clients_with_znodes). +#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] +#[kube( + group = "zookeeper.stackable.tech", + version = "v1alpha1", + kind = "ZookeeperZnode", + plural = "zookeeperznodes", + shortname = "zno", + shortname = "znode", + status = "ZookeeperZnodeStatus", + namespaced, + crates( + kube_core = "stackable_operator::kube::core", + k8s_openapi = "stackable_operator::k8s_openapi", + schemars = "stackable_operator::schemars" + ) +)] +#[serde(rename_all = "camelCase")] +pub struct ZookeeperZnodeSpec { + /// The reference to the ZookeeperCluster that this ZNode belongs to. + #[serde(default)] + pub cluster_ref: ClusterRef, +} + +#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct ZookeeperZnodeStatus { + /// The absolute ZNode allocated to the ZookeeperZnode. This will typically be set by the operator. + /// + /// This can be set explicitly by an administrator, such as when restoring from a backup. + pub znode_path: Option, +} + +impl CurrentlySupportedListenerClasses { + pub fn k8s_service_type(&self) -> String { + match self { + CurrentlySupportedListenerClasses::ClusterInternal => "ClusterIP".to_string(), + CurrentlySupportedListenerClasses::ExternalUnstable => "NodePort".to_string(), + } + } +} + impl ZookeeperConfig { pub const INIT_LIMIT: &'static str = "initLimit"; pub const SYNC_LIMIT: &'static str = "syncLimit"; @@ -415,25 +502,6 @@ impl Configuration for ZookeeperConfigFragment { } } -#[derive( - Clone, - Debug, - Deserialize, - Display, - EnumIter, - Eq, - Hash, - JsonSchema, - PartialEq, - Serialize, - EnumString, -)] -#[strum(serialize_all = "camelCase")] -pub enum ZookeeperRole { - #[strum(serialize = "server")] - Server, -} - impl ZookeeperRole { pub fn roles() -> Vec { let mut roles = vec![]; @@ -444,16 +512,6 @@ impl ZookeeperRole { } } -#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperClusterStatus { - /// An opaque value that changes every time a discovery detail does - #[serde(default, skip_serializing_if = "Option::is_none")] - pub discovery_hash: Option, - #[serde(default)] - pub conditions: Vec, -} - impl HasStatusCondition for ZookeeperCluster { fn conditions(&self) -> Vec { match &self.status { @@ -463,9 +521,16 @@ impl HasStatusCondition for ZookeeperCluster { } } -pub enum LoggingFramework { - LOG4J, - LOGBACK, +impl ZookeeperPodRef { + pub fn fqdn(&self, cluster_info: &KubernetesClusterInfo) -> String { + format!( + "{pod_name}.{service_name}.{namespace}.svc.{cluster_domain}", + pod_name = self.pod_name, + service_name = self.role_group_service_name, + namespace = self.namespace, + cluster_domain = cluster_info.cluster_domain + ) + } } impl ZookeeperCluster { @@ -672,71 +737,6 @@ impl ZookeeperCluster { } } -/// Reference to a single `Pod` that is a component of a [`ZookeeperCluster`] -/// -/// Used for service discovery. -pub struct ZookeeperPodRef { - pub namespace: String, - pub role_group_service_name: String, - pub pod_name: String, - pub zookeeper_myid: u16, -} - -impl ZookeeperPodRef { - pub fn fqdn(&self, cluster_info: &KubernetesClusterInfo) -> String { - format!( - "{pod_name}.{service_name}.{namespace}.svc.{cluster_domain}", - pod_name = self.pod_name, - service_name = self.role_group_service_name, - namespace = self.namespace, - cluster_domain = cluster_info.cluster_domain - ) - } -} - -/// A claim for a single ZooKeeper ZNode tree (filesystem node). -/// -/// A ConfigMap will automatically be created with the same name, containing the connection string in the field `ZOOKEEPER`. -/// Each ZookeeperZnode gets an isolated ZNode chroot, which the `ZOOKEEPER` automatically contains. -/// All data inside of this chroot will be deleted when the corresponding `ZookeeperZnode` is. -/// -/// `ZookeeperZnode` is *not* designed to manage the contents of this ZNode. Instead, it should be used to create a chroot -/// for an installation of an application to work inside. Initializing the contents is the responsibility of the application. -/// -/// You can learn more about this in the -/// [Isolating clients with ZNodes usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/isolating_clients_with_znodes). -#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] -#[kube( - group = "zookeeper.stackable.tech", - version = "v1alpha1", - kind = "ZookeeperZnode", - plural = "zookeeperznodes", - shortname = "zno", - shortname = "znode", - status = "ZookeeperZnodeStatus", - namespaced, - crates( - kube_core = "stackable_operator::kube::core", - k8s_openapi = "stackable_operator::k8s_openapi", - schemars = "stackable_operator::schemars" - ) -)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperZnodeSpec { - /// The reference to the ZookeeperCluster that this ZNode belongs to. - #[serde(default)] - pub cluster_ref: ClusterRef, -} - -#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperZnodeStatus { - /// The absolute ZNode allocated to the ZookeeperZnode. This will typically be set by the operator. - /// - /// This can be set explicitly by an administrator, such as when restoring from a backup. - pub znode_path: Option, -} - #[cfg(test)] mod tests { use super::*; From fd2f4d0437ef13870de07ed446d38234bf3a599d Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 10 Feb 2025 18:55:20 +0100 Subject: [PATCH 04/11] chore: version the crd --- rust/operator-binary/src/crd/affinity.rs | 4 +- rust/operator-binary/src/crd/mod.rs | 589 +++++++++--------- rust/operator-binary/src/crd/security.rs | 2 +- rust/operator-binary/src/discovery.rs | 7 +- rust/operator-binary/src/main.rs | 5 +- .../src/operations/graceful_shutdown.rs | 2 +- rust/operator-binary/src/operations/pdb.rs | 5 +- rust/operator-binary/src/product_logging.rs | 5 +- rust/operator-binary/src/zk_controller.rs | 4 +- rust/operator-binary/src/znode_controller.rs | 3 +- 10 files changed, 329 insertions(+), 297 deletions(-) diff --git a/rust/operator-binary/src/crd/affinity.rs b/rust/operator-binary/src/crd/affinity.rs index c4d6e7a2..95d40db8 100644 --- a/rust/operator-binary/src/crd/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -3,7 +3,7 @@ use stackable_operator::{ k8s_openapi::api::core::v1::PodAntiAffinity, }; -use crate::crd::{ZookeeperRole, APP_NAME}; +use crate::crd::{v1alpha1::ZookeeperRole, APP_NAME}; pub fn get_affinity(cluster_name: &str, role: &ZookeeperRole) -> StackableAffinityFragment { let affinity_between_role_pods = @@ -37,7 +37,7 @@ mod tests { role_utils::RoleGroupRef, }; - use crate::{crd::affinity::ZookeeperRole, ZookeeperCluster}; + use crate::crd::{affinity::ZookeeperRole, v1alpha1::ZookeeperCluster}; #[test] fn test_affinity_defaults() { diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 1c3b0b94..1d5bfe4e 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -33,6 +33,7 @@ use stackable_operator::{ time::Duration, utils::cluster_info::KubernetesClusterInfo, }; +use stackable_versioned::versioned; use strum::{Display, EnumIter, EnumString, IntoEnumIterator}; use crate::crd::{ @@ -113,271 +114,273 @@ pub enum Error { }, } -/// A ZooKeeper cluster stacklet. This resource is managed by the Stackable operator for Apache ZooKeeper. -/// Find more information on how to use it and the resources that the operator generates in the -/// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/zookeeper/). -#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] -#[kube( - group = "zookeeper.stackable.tech", - version = "v1alpha1", - kind = "ZookeeperCluster", - plural = "zookeeperclusters", - shortname = "zk", - status = "ZookeeperClusterStatus", - namespaced, - crates( - kube_core = "stackable_operator::kube::core", - k8s_openapi = "stackable_operator::k8s_openapi", - schemars = "stackable_operator::schemars" - ) -)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperClusterSpec { - /// Settings that affect all roles and role groups. - /// The settings in the `clusterConfig` are cluster wide settings that do not need to be configurable at role or role group level. - #[serde(default = "cluster_config_default")] - pub cluster_config: ZookeeperClusterConfig, - // no doc - it's in the struct. - #[serde(default)] - pub cluster_operation: ClusterOperation, - // no doc - it's in the struct. - pub image: ProductImage, - // no doc - it's in the struct. - #[serde(skip_serializing_if = "Option::is_none")] - pub servers: Option>, +pub enum LoggingFramework { + LOG4J, + LOGBACK, } -#[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperClusterConfig { - /// Authentication settings for ZooKeeper like mTLS authentication. - /// Read more in the [authentication usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/authentication). - #[serde(default)] - pub authentication: Vec, - - /// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery). - /// It must contain the key `ADDRESS` with the address of the Vector aggregator. - /// Follow the [logging tutorial](DOCS_BASE_URL_PLACEHOLDER/tutorials/logging-vector-aggregator) - /// to learn how to configure log aggregation with Vector. - #[serde(skip_serializing_if = "Option::is_none")] - pub vector_aggregator_config_map_name: Option, - - /// TLS encryption settings for ZooKeeper (server, quorum). - /// Read more in the [encryption usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/encryption). - #[serde( - default = "tls::default_zookeeper_tls", - skip_serializing_if = "Option::is_none" - )] - pub tls: Option, +#[versioned(version(name = "v1alpha1"))] +pub mod versioned { + /// A ZooKeeper cluster stacklet. This resource is managed by the Stackable operator for Apache ZooKeeper. + /// Find more information on how to use it and the resources that the operator generates in the + /// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/zookeeper/). + #[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] + #[versioned(k8s( + group = "zookeeper.stackable.tech", + kind = "ZookeeperCluster", + plural = "zookeeperclusters", + shortname = "zk", + status = "ZookeeperClusterStatus", + namespaced, + crates( + kube_core = "stackable_operator::kube::core", + k8s_openapi = "stackable_operator::k8s_openapi", + schemars = "stackable_operator::schemars" + ) + ))] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperClusterSpec { + /// Settings that affect all roles and role groups. + /// The settings in the `clusterConfig` are cluster wide settings that do not need to be configurable at role or role group level. + #[serde(default = "cluster_config_default")] + pub cluster_config: v1alpha1::ZookeeperClusterConfig, + // no doc - it's in the struct. + #[serde(default)] + pub cluster_operation: ClusterOperation, + // no doc - it's in the struct. + pub image: ProductImage, + // no doc - it's in the struct. + #[serde(skip_serializing_if = "Option::is_none")] + pub servers: Option>, + } - /// This field controls which type of Service the Operator creates for this ZookeeperCluster: - /// - /// * cluster-internal: Use a ClusterIP service - /// - /// * external-unstable: Use a NodePort service - /// - /// This is a temporary solution with the goal to keep yaml manifests forward compatible. - /// In the future, this setting will control which [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html) - /// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change. - #[serde(default)] - pub listener_class: CurrentlySupportedListenerClasses, -} + #[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperClusterConfig { + /// Authentication settings for ZooKeeper like mTLS authentication. + /// Read more in the [authentication usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/authentication). + #[serde(default)] + pub authentication: Vec, + + /// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery). + /// It must contain the key `ADDRESS` with the address of the Vector aggregator. + /// Follow the [logging tutorial](DOCS_BASE_URL_PLACEHOLDER/tutorials/logging-vector-aggregator) + /// to learn how to configure log aggregation with Vector. + #[serde(skip_serializing_if = "Option::is_none")] + pub vector_aggregator_config_map_name: Option, + + /// TLS encryption settings for ZooKeeper (server, quorum). + /// Read more in the [encryption usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/encryption). + #[serde( + default = "tls::default_zookeeper_tls", + skip_serializing_if = "Option::is_none" + )] + pub tls: Option, + + /// This field controls which type of Service the Operator creates for this ZookeeperCluster: + /// + /// * cluster-internal: Use a ClusterIP service + /// + /// * external-unstable: Use a NodePort service + /// + /// This is a temporary solution with the goal to keep yaml manifests forward compatible. + /// In the future, this setting will control which [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html) + /// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change. + #[serde(default)] + pub listener_class: v1alpha1::CurrentlySupportedListenerClasses, + } -fn cluster_config_default() -> ZookeeperClusterConfig { - ZookeeperClusterConfig { - authentication: vec![], - vector_aggregator_config_map_name: None, - tls: tls::default_zookeeper_tls(), - listener_class: CurrentlySupportedListenerClasses::default(), + // TODO: Temporary solution until listener-operator is finished + #[derive(Clone, Debug, Default, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "PascalCase")] + pub enum CurrentlySupportedListenerClasses { + #[default] + #[serde(rename = "cluster-internal")] + ClusterInternal, + #[serde(rename = "external-unstable")] + ExternalUnstable, } -} -// TODO: Temporary solution until listener-operator is finished -#[derive(Clone, Debug, Default, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "PascalCase")] -pub enum CurrentlySupportedListenerClasses { - #[default] - #[serde(rename = "cluster-internal")] - ClusterInternal, - #[serde(rename = "external-unstable")] - ExternalUnstable, -} + #[derive(Clone, Debug, Default, JsonSchema, PartialEq, Fragment)] + #[fragment_attrs( + derive( + Clone, + Debug, + Default, + Deserialize, + Merge, + JsonSchema, + PartialEq, + Serialize + ), + serde(rename_all = "camelCase") + )] + pub struct ZookeeperStorageConfig { + #[fragment_attrs(serde(default))] + pub data: PvcConfig, + } -#[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] -#[fragment_attrs( - derive( + #[derive( Clone, Debug, - Default, Deserialize, - Merge, + Display, + Eq, + EnumIter, JsonSchema, + Ord, PartialEq, - Serialize - ), - serde(rename_all = "camelCase") -)] -pub struct ZookeeperConfig { - pub init_limit: Option, - pub sync_limit: Option, - pub tick_time: Option, - pub myid_offset: u16, - - #[fragment_attrs(serde(default))] - pub resources: Resources, - - #[fragment_attrs(serde(default))] - pub logging: Logging, - - #[fragment_attrs(serde(default))] - pub affinity: StackableAffinity, - - /// Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. - #[fragment_attrs(serde(default))] - pub graceful_shutdown_timeout: Option, - - /// Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. - /// This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate. - #[fragment_attrs(serde(default))] - pub requested_secret_lifetime: Option, -} + PartialOrd, + Serialize, + )] + #[serde(rename_all = "camelCase")] + pub enum Container { + Prepare, + Vector, + Zookeeper, + } + + #[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] + #[fragment_attrs( + derive( + Clone, + Debug, + Default, + Deserialize, + Merge, + JsonSchema, + PartialEq, + Serialize + ), + serde(rename_all = "camelCase") + )] + pub struct ZookeeperConfig { + pub init_limit: Option, + pub sync_limit: Option, + pub tick_time: Option, + pub myid_offset: u16, -#[derive(Clone, Debug, Default, JsonSchema, PartialEq, Fragment)] -#[fragment_attrs( - derive( + #[fragment_attrs(serde(default))] + pub resources: Resources, + + #[fragment_attrs(serde(default))] + pub logging: Logging, + + #[fragment_attrs(serde(default))] + pub affinity: StackableAffinity, + + /// Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details. + #[fragment_attrs(serde(default))] + pub graceful_shutdown_timeout: Option, + + /// Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. + /// This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate. + #[fragment_attrs(serde(default))] + pub requested_secret_lifetime: Option, + } + + #[derive( Clone, Debug, - Default, Deserialize, - Merge, + Display, + EnumIter, + Eq, + Hash, JsonSchema, PartialEq, - Serialize - ), - serde(rename_all = "camelCase") -)] -pub struct ZookeeperStorageConfig { - #[fragment_attrs(serde(default))] - pub data: PvcConfig, -} - -#[derive( - Clone, - Debug, - Deserialize, - Display, - Eq, - EnumIter, - JsonSchema, - Ord, - PartialEq, - PartialOrd, - Serialize, -)] -#[serde(rename_all = "camelCase")] -pub enum Container { - Prepare, - Vector, - Zookeeper, -} - -#[derive( - Clone, - Debug, - Deserialize, - Display, - EnumIter, - Eq, - Hash, - JsonSchema, - PartialEq, - Serialize, - EnumString, -)] -#[strum(serialize_all = "camelCase")] -pub enum ZookeeperRole { - #[strum(serialize = "server")] - Server, -} + Serialize, + EnumString, + )] + #[strum(serialize_all = "camelCase")] + pub enum ZookeeperRole { + #[strum(serialize = "server")] + Server, + } -#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperClusterStatus { - /// An opaque value that changes every time a discovery detail does - #[serde(default, skip_serializing_if = "Option::is_none")] - pub discovery_hash: Option, - #[serde(default)] - pub conditions: Vec, -} + #[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperClusterStatus { + /// An opaque value that changes every time a discovery detail does + #[serde(default, skip_serializing_if = "Option::is_none")] + pub discovery_hash: Option, + #[serde(default)] + pub conditions: Vec, + } -pub enum LoggingFramework { - LOG4J, - LOGBACK, -} + /// Reference to a single `Pod` that is a component of a [`ZookeeperCluster`] + /// + /// Used for service discovery. + pub struct ZookeeperPodRef { + pub namespace: String, + pub role_group_service_name: String, + pub pod_name: String, + pub zookeeper_myid: u16, + } -/// Reference to a single `Pod` that is a component of a [`ZookeeperCluster`] -/// -/// Used for service discovery. -pub struct ZookeeperPodRef { - pub namespace: String, - pub role_group_service_name: String, - pub pod_name: String, - pub zookeeper_myid: u16, -} + /// A claim for a single ZooKeeper ZNode tree (filesystem node). + /// + /// A ConfigMap will automatically be created with the same name, containing the connection string in the field `ZOOKEEPER`. + /// Each ZookeeperZnode gets an isolated ZNode chroot, which the `ZOOKEEPER` automatically contains. + /// All data inside of this chroot will be deleted when the corresponding `ZookeeperZnode` is. + /// + /// `ZookeeperZnode` is *not* designed to manage the contents of this ZNode. Instead, it should be used to create a chroot + /// for an installation of an application to work inside. Initializing the contents is the responsibility of the application. + /// + /// You can learn more about this in the + /// [Isolating clients with ZNodes usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/isolating_clients_with_znodes). + #[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] + #[kube( + group = "zookeeper.stackable.tech", + version = "v1alpha1", + kind = "ZookeeperZnode", + plural = "zookeeperznodes", + shortname = "zno", + shortname = "znode", + status = "ZookeeperZnodeStatus", + namespaced, + crates( + kube_core = "stackable_operator::kube::core", + k8s_openapi = "stackable_operator::k8s_openapi", + schemars = "stackable_operator::schemars" + ) + )] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperZnodeSpec { + /// The reference to the ZookeeperCluster that this ZNode belongs to. + #[serde(default)] + pub cluster_ref: ClusterRef, + } -/// A claim for a single ZooKeeper ZNode tree (filesystem node). -/// -/// A ConfigMap will automatically be created with the same name, containing the connection string in the field `ZOOKEEPER`. -/// Each ZookeeperZnode gets an isolated ZNode chroot, which the `ZOOKEEPER` automatically contains. -/// All data inside of this chroot will be deleted when the corresponding `ZookeeperZnode` is. -/// -/// `ZookeeperZnode` is *not* designed to manage the contents of this ZNode. Instead, it should be used to create a chroot -/// for an installation of an application to work inside. Initializing the contents is the responsibility of the application. -/// -/// You can learn more about this in the -/// [Isolating clients with ZNodes usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/isolating_clients_with_znodes). -#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] -#[kube( - group = "zookeeper.stackable.tech", - version = "v1alpha1", - kind = "ZookeeperZnode", - plural = "zookeeperznodes", - shortname = "zno", - shortname = "znode", - status = "ZookeeperZnodeStatus", - namespaced, - crates( - kube_core = "stackable_operator::kube::core", - k8s_openapi = "stackable_operator::k8s_openapi", - schemars = "stackable_operator::schemars" - ) -)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperZnodeSpec { - /// The reference to the ZookeeperCluster that this ZNode belongs to. - #[serde(default)] - pub cluster_ref: ClusterRef, + #[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperZnodeStatus { + /// The absolute ZNode allocated to the ZookeeperZnode. This will typically be set by the operator. + /// + /// This can be set explicitly by an administrator, such as when restoring from a backup. + pub znode_path: Option, + } } -#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperZnodeStatus { - /// The absolute ZNode allocated to the ZookeeperZnode. This will typically be set by the operator. - /// - /// This can be set explicitly by an administrator, such as when restoring from a backup. - pub znode_path: Option, +fn cluster_config_default() -> v1alpha1::ZookeeperClusterConfig { + v1alpha1::ZookeeperClusterConfig { + authentication: vec![], + vector_aggregator_config_map_name: None, + tls: tls::default_zookeeper_tls(), + listener_class: v1alpha1::CurrentlySupportedListenerClasses::default(), + } } -impl CurrentlySupportedListenerClasses { +impl v1alpha1::CurrentlySupportedListenerClasses { pub fn k8s_service_type(&self) -> String { match self { - CurrentlySupportedListenerClasses::ClusterInternal => "ClusterIP".to_string(), - CurrentlySupportedListenerClasses::ExternalUnstable => "NodePort".to_string(), + v1alpha1::CurrentlySupportedListenerClasses::ClusterInternal => "ClusterIP".to_string(), + v1alpha1::CurrentlySupportedListenerClasses::ExternalUnstable => "NodePort".to_string(), } } } -impl ZookeeperConfig { +impl v1alpha1::ZookeeperConfig { pub const INIT_LIMIT: &'static str = "initLimit"; pub const SYNC_LIMIT: &'static str = "syncLimit"; pub const TICK_TIME: &'static str = "tickTime"; @@ -389,8 +392,11 @@ impl ZookeeperConfig { const DEFAULT_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1); - fn default_server_config(cluster_name: &str, role: &ZookeeperRole) -> ZookeeperConfigFragment { - ZookeeperConfigFragment { + fn default_server_config( + cluster_name: &str, + role: &v1alpha1::ZookeeperRole, + ) -> v1alpha1::ZookeeperConfigFragment { + v1alpha1::ZookeeperConfigFragment { init_limit: None, sync_limit: None, tick_time: None, @@ -404,7 +410,7 @@ impl ZookeeperConfig { limit: Some(Quantity("512Mi".to_owned())), runtime_limits: NoRuntimeLimitsFragment {}, }, - storage: ZookeeperStorageConfigFragment { + storage: v1alpha1::ZookeeperStorageConfigFragment { data: PvcConfigFragment { capacity: Some(Quantity("1Gi".to_owned())), storage_class: None, @@ -420,8 +426,8 @@ impl ZookeeperConfig { } } -impl Configuration for ZookeeperConfigFragment { - type Configurable = ZookeeperCluster; +impl Configuration for v1alpha1::ZookeeperConfigFragment { + type Configurable = v1alpha1::ZookeeperCluster; fn compute_env( &self, @@ -441,17 +447,17 @@ impl Configuration for ZookeeperConfigFragment { Ok([ ( - ZookeeperConfig::MYID_OFFSET.to_string(), + v1alpha1::ZookeeperConfig::MYID_OFFSET.to_string(), self.myid_offset - .or(ZookeeperConfig::default_server_config( + .or(v1alpha1::ZookeeperConfig::default_server_config( &resource.name_any(), - &ZookeeperRole::Server, + &v1alpha1::ZookeeperRole::Server, ) .myid_offset) .map(|myid_offset| myid_offset.to_string()), ), ( - ZookeeperConfig::SERVER_JVMFLAGS.to_string(), + v1alpha1::ZookeeperConfig::SERVER_JVMFLAGS.to_string(), Some(jvm_flags), ), ] @@ -476,24 +482,24 @@ impl Configuration for ZookeeperConfigFragment { if file == ZOOKEEPER_PROPERTIES_FILE { if let Some(init_limit) = self.init_limit { result.insert( - ZookeeperConfig::INIT_LIMIT.to_string(), + v1alpha1::ZookeeperConfig::INIT_LIMIT.to_string(), Some(init_limit.to_string()), ); } if let Some(sync_limit) = self.sync_limit { result.insert( - ZookeeperConfig::SYNC_LIMIT.to_string(), + v1alpha1::ZookeeperConfig::SYNC_LIMIT.to_string(), Some(sync_limit.to_string()), ); } if let Some(tick_time) = self.tick_time { result.insert( - ZookeeperConfig::TICK_TIME.to_string(), + v1alpha1::ZookeeperConfig::TICK_TIME.to_string(), Some(tick_time.to_string()), ); } result.insert( - ZookeeperConfig::DATA_DIR.to_string(), + v1alpha1::ZookeeperConfig::DATA_DIR.to_string(), Some(STACKABLE_DATA_DIR.to_string()), ); } @@ -502,7 +508,7 @@ impl Configuration for ZookeeperConfigFragment { } } -impl ZookeeperRole { +impl v1alpha1::ZookeeperRole { pub fn roles() -> Vec { let mut roles = vec![]; for role in Self::iter() { @@ -512,7 +518,7 @@ impl ZookeeperRole { } } -impl HasStatusCondition for ZookeeperCluster { +impl HasStatusCondition for v1alpha1::ZookeeperCluster { fn conditions(&self) -> Vec { match &self.status { Some(status) => status.conditions.clone(), @@ -521,7 +527,7 @@ impl HasStatusCondition for ZookeeperCluster { } } -impl ZookeeperPodRef { +impl v1alpha1::ZookeeperPodRef { pub fn fqdn(&self, cluster_info: &KubernetesClusterInfo) -> String { format!( "{pod_name}.{service_name}.{namespace}.svc.{cluster_domain}", @@ -533,7 +539,7 @@ impl ZookeeperPodRef { } } -impl ZookeeperCluster { +impl v1alpha1::ZookeeperCluster { pub fn logging_framework(&self) -> LoggingFramework { let version = self .spec @@ -575,10 +581,10 @@ impl ZookeeperCluster { /// Returns a reference to the role. Raises an error if the role is not defined. pub fn role( &self, - role_variant: &ZookeeperRole, - ) -> Result<&Role, Error> { + role_variant: &v1alpha1::ZookeeperRole, + ) -> Result<&Role, Error> { match role_variant { - ZookeeperRole::Server => self.spec.servers.as_ref(), + v1alpha1::ZookeeperRole::Server => self.spec.servers.as_ref(), } .with_context(|| CannotRetrieveZookeeperRoleSnafu { role: role_variant.to_string(), @@ -588,14 +594,18 @@ impl ZookeeperCluster { /// Returns a reference to the role group. Raises an error if the role or role group are not defined. pub fn rolegroup( &self, - rolegroup_ref: &RoleGroupRef, - ) -> Result, Error> { - let role_variant = ZookeeperRole::from_str(&rolegroup_ref.role).with_context(|_| { - UnknownZookeeperRoleSnafu { - role: rolegroup_ref.role.to_owned(), - roles: ZookeeperRole::roles(), - } - })?; + rolegroup_ref: &RoleGroupRef, + ) -> Result< + RoleGroup, + Error, + > { + let role_variant = + v1alpha1::ZookeeperRole::from_str(&rolegroup_ref.role).with_context(|_| { + UnknownZookeeperRoleSnafu { + role: rolegroup_ref.role.to_owned(), + roles: v1alpha1::ZookeeperRole::roles(), + } + })?; let role = self.role(&role_variant)?; role.role_groups .get(&rolegroup_ref.role_group) @@ -609,17 +619,17 @@ impl ZookeeperCluster { pub fn server_rolegroup_ref( &self, group_name: impl Into, - ) -> RoleGroupRef { + ) -> RoleGroupRef { RoleGroupRef { cluster: ObjectRef::from_obj(self), - role: ZookeeperRole::Server.to_string(), + role: v1alpha1::ZookeeperRole::Server.to_string(), role_group: group_name.into(), } } - pub fn role_config(&self, role: &ZookeeperRole) -> Option<&GenericRoleConfig> { + pub fn role_config(&self, role: &v1alpha1::ZookeeperRole) -> Option<&GenericRoleConfig> { match role { - ZookeeperRole::Server => self.spec.servers.as_ref().map(|s| &s.role_config), + v1alpha1::ZookeeperRole::Server => self.spec.servers.as_ref().map(|s| &s.role_config), } } @@ -629,7 +639,7 @@ impl ZookeeperCluster { /// avoid instance churn. For example, regenerating zoo.cfg based on the cluster state would lead to /// a lot of spurious restarts, as well as opening us up to dangerous split-brain conditions because /// the pods have inconsistent snapshots of which servers they should expect to be in quorum. - pub fn pods(&self) -> Result + '_, Error> { + pub fn pods(&self) -> Result + '_, Error> { let ns = self.metadata.namespace.clone().context(NoNamespaceSnafu)?; let role_groups = self .spec @@ -642,12 +652,12 @@ impl ZookeeperCluster { for (rolegroup_name, rolegroup) in role_groups { let rolegroup_ref = self.server_rolegroup_ref(rolegroup_name); let myid_offset = self - .merged_config(&ZookeeperRole::Server, &rolegroup_ref)? + .merged_config(&v1alpha1::ZookeeperRole::Server, &rolegroup_ref)? .myid_offset; let ns = ns.clone(); // In case no replicas are specified we default to 1 for i in 0..rolegroup.replicas.unwrap_or(1) { - pod_refs.push(ZookeeperPodRef { + pod_refs.push(v1alpha1::ZookeeperPodRef { namespace: ns.clone(), role_group_service_name: rolegroup_ref.object_name(), pod_name: format!("{}-{}", rolegroup_ref.object_name(), i), @@ -660,11 +670,12 @@ impl ZookeeperCluster { pub fn merged_config( &self, - role: &ZookeeperRole, + role: &v1alpha1::ZookeeperRole, rolegroup_ref: &RoleGroupRef, - ) -> Result { + ) -> Result { // Initialize the result with all default values as baseline - let conf_defaults = ZookeeperConfig::default_server_config(&self.name_any(), role); + let conf_defaults = + v1alpha1::ZookeeperConfig::default_server_config(&self.name_any(), role); // Retrieve role resource config let role = self.role(role)?; @@ -687,9 +698,9 @@ impl ZookeeperCluster { pub fn logging( &self, - role: &ZookeeperRole, + role: &v1alpha1::ZookeeperRole, rolegroup_ref: &RoleGroupRef, - ) -> Result, Error> { + ) -> Result, Error> { let config = self.merged_config(role, rolegroup_ref)?; Ok(config.logging) } @@ -702,11 +713,12 @@ impl ZookeeperCluster { /// 3. a default PVC with 1Gi capacity pub fn resources( &self, - role: &ZookeeperRole, - rolegroup_ref: &RoleGroupRef, + role: &v1alpha1::ZookeeperRole, + rolegroup_ref: &RoleGroupRef, ) -> Result<(Vec, ResourceRequirements), Error> { let config = self.merged_config(role, rolegroup_ref)?; - let resources: Resources = config.resources; + let resources: Resources = + config.resources; let data_pvc = resources .storage @@ -741,7 +753,7 @@ impl ZookeeperCluster { mod tests { use super::*; - fn get_server_secret_class(zk: &ZookeeperCluster) -> Option<&str> { + fn get_server_secret_class(zk: &v1alpha1::ZookeeperCluster) -> Option<&str> { zk.spec .cluster_config .tls @@ -749,7 +761,7 @@ mod tests { .and_then(|tls| tls.server_secret_class.as_deref()) } - fn get_quorum_secret_class(zk: &ZookeeperCluster) -> &str { + fn get_quorum_secret_class(zk: &v1alpha1::ZookeeperCluster) -> &str { zk.spec .cluster_config .tls @@ -770,7 +782,8 @@ mod tests { image: productVersion: "3.9.2" "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( get_server_secret_class(&zookeeper), tls::server_tls_default().as_deref() @@ -792,7 +805,8 @@ mod tests { tls: serverSecretClass: simple-zookeeper-client-tls "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( get_server_secret_class(&zookeeper), @@ -815,7 +829,8 @@ mod tests { tls: serverSecretClass: null "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!(get_server_secret_class(&zookeeper), None); assert_eq!( get_quorum_secret_class(&zookeeper), @@ -834,7 +849,8 @@ mod tests { tls: quorumSecretClass: simple-zookeeper-quorum-tls "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( get_server_secret_class(&zookeeper), tls::server_tls_default().as_deref() @@ -856,7 +872,8 @@ mod tests { image: productVersion: "3.9.2" "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( get_server_secret_class(&zookeeper), @@ -879,7 +896,8 @@ mod tests { tls: quorumSecretClass: simple-zookeeper-quorum-tls "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( get_server_secret_class(&zookeeper), tls::server_tls_default().as_deref() @@ -901,7 +919,8 @@ mod tests { tls: serverSecretClass: simple-zookeeper-server-tls "#; - let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zookeeper: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( get_server_secret_class(&zookeeper), Some("simple-zookeeper-server-tls") diff --git a/rust/operator-binary/src/crd/security.rs b/rust/operator-binary/src/crd/security.rs index 477b4b0e..ee210f9f 100644 --- a/rust/operator-binary/src/crd/security.rs +++ b/rust/operator-binary/src/crd/security.rs @@ -26,7 +26,7 @@ use stackable_operator::{ }; use crate::crd::{ - authentication, authentication::ResolvedAuthenticationClasses, tls, ZookeeperCluster, + authentication, authentication::ResolvedAuthenticationClasses, tls, v1alpha1::ZookeeperCluster, }; type Result = std::result::Result; diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index a797fba5..cc8c6404 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -10,7 +10,10 @@ use stackable_operator::{ }; use crate::{ - crd::{security::ZookeeperSecurity, ZookeeperCluster, ZookeeperRole}, + crd::{ + security::ZookeeperSecurity, + v1alpha1::{ZookeeperCluster, ZookeeperRole}, + }, utils::build_recommended_labels, }; @@ -89,7 +92,7 @@ pub async fn build_discovery_configmaps( resolved_product_image, )?]; if zk.spec.cluster_config.listener_class - == crate::crd::CurrentlySupportedListenerClasses::ExternalUnstable + == crate::crd::v1alpha1::CurrentlySupportedListenerClasses::ExternalUnstable { discovery_configmaps.push(build_discovery_configmap( zk, diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 21f90163..6c0f99b5 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,7 +1,10 @@ use std::sync::Arc; use clap::{crate_description, crate_version, Parser}; -use crd::{ZookeeperCluster, ZookeeperZnode, APP_NAME, OPERATOR_NAME}; +use crd::{ + v1alpha1::{ZookeeperCluster, ZookeeperZnode}, + APP_NAME, OPERATOR_NAME, +}; use futures::{pin_mut, StreamExt}; use stackable_operator::{ cli::{Command, ProductOperatorRun}, diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index af871600..f6bcc2f0 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -1,7 +1,7 @@ use snafu::{ResultExt, Snafu}; use stackable_operator::builder::pod::PodBuilder; -use crate::crd::ZookeeperConfig; +use crate::crd::v1alpha1::ZookeeperConfig; #[derive(Debug, Snafu)] pub enum Error { diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 8f03e897..a4e0752e 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -5,7 +5,10 @@ use stackable_operator::{ }; use crate::{ - crd::{ZookeeperCluster, ZookeeperRole, APP_NAME, OPERATOR_NAME}, + crd::{ + v1alpha1::{ZookeeperCluster, ZookeeperRole}, + APP_NAME, OPERATOR_NAME, + }, zk_controller::ZK_CONTROLLER_NAME, }; diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index d2a79453..4f6b97e7 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -13,8 +13,9 @@ use stackable_operator::{ }; use crate::crd::{ - Container, LoggingFramework, ZookeeperCluster, ZookeeperRole, LOG4J_CONFIG_FILE, - LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, + v1alpha1::{Container, ZookeeperCluster, ZookeeperRole}, + LoggingFramework, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, + STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, }; #[derive(Snafu, Debug)] diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 45fb9441..a497bc0d 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -70,7 +70,9 @@ use crate::{ command::create_init_container_command_args, crd::{ security::{self, ZookeeperSecurity}, - Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig, ZookeeperRole, + v1alpha1::{ + Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig, ZookeeperRole, + }, DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, MAX_PREPARE_LOG_FILE_SIZE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, diff --git a/rust/operator-binary/src/znode_controller.rs b/rust/operator-binary/src/znode_controller.rs index fe881561..7356c971 100644 --- a/rust/operator-binary/src/znode_controller.rs +++ b/rust/operator-binary/src/znode_controller.rs @@ -25,7 +25,8 @@ use tracing::{debug, info}; use crate::{ crd::{ - security::ZookeeperSecurity, ZookeeperCluster, ZookeeperZnode, ZookeeperZnodeStatus, + security::ZookeeperSecurity, + v1alpha1::{ZookeeperCluster, ZookeeperZnode, ZookeeperZnodeStatus}, DOCKER_IMAGE_BASE_NAME, }, discovery::{self, build_discovery_configmaps}, From 1c34d988dadc4b0a280378a0f529e3db898efff0 Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 10 Feb 2025 19:13:52 +0100 Subject: [PATCH 05/11] docs: update references to include the version --- rust/operator-binary/src/crd/mod.rs | 2 +- rust/operator-binary/src/discovery.rs | 6 +++--- rust/operator-binary/src/zk_controller.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 1d5bfe4e..2a070733 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -308,7 +308,7 @@ pub mod versioned { pub conditions: Vec, } - /// Reference to a single `Pod` that is a component of a [`ZookeeperCluster`] + /// Reference to a single `Pod` that is a component of a [`v1alpha1::ZookeeperCluster`] /// /// Used for service discovery. pub struct ZookeeperPodRef { diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index cc8c6404..7691c0fc 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -65,7 +65,7 @@ pub enum Error { }, } -/// Builds discovery [`ConfigMap`]s for connecting to a [`ZookeeperCluster`] for all expected scenarios +/// Builds discovery [`ConfigMap`]s for connecting to a [`v1alpha1::ZookeeperCluster`] for all expected scenarios #[allow(clippy::too_many_arguments)] pub async fn build_discovery_configmaps( zk: &ZookeeperCluster, @@ -110,7 +110,7 @@ pub async fn build_discovery_configmaps( Ok(discovery_configmaps) } -/// Build a discovery [`ConfigMap`] containing information about how to connect to a certain [`ZookeeperCluster`] +/// Build a discovery [`ConfigMap`] containing information about how to connect to a certain [`v1alpha1::ZookeeperCluster`] /// /// `hosts` will usually come from either [`pod_hosts`] or [`nodeport_hosts`]. #[allow(clippy::too_many_arguments)] @@ -171,7 +171,7 @@ fn build_discovery_configmap( .context(BuildConfigMapSnafu) } -/// Lists all Pods FQDNs expected to host the [`ZookeeperCluster`] +/// Lists all Pods FQDNs expected to host the [`v1alpha1::ZookeeperCluster`] fn pod_hosts<'a>( zk: &'a ZookeeperCluster, zookeeper_security: &'a ZookeeperSecurity, diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index a497bc0d..db5c463a 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -525,7 +525,7 @@ pub async fn reconcile_zk( /// The server-role service is the primary endpoint that should be used by clients that do not perform internal load balancing, /// including targets outside of the cluster. /// -/// Note that you should generally *not* hard-code clients to use these services; instead, create a [`ZookeeperZnode`](`stackable_zookeeper_crd::ZookeeperZnode`) +/// Note that you should generally *not* hard-code clients to use these services; instead, create a [`v1alpha1::ZookeeperZnode`](`crate::crd::v1alpha1::ZookeeperZnode`) /// and use the connection string that it gives you. pub fn build_server_role_service( zk: &ZookeeperCluster, From 6bbdbe6c3e9130e6b4ad3d4713159f282b48cc6a Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 10 Feb 2025 19:20:47 +0100 Subject: [PATCH 06/11] docs: update references to include the version --- rust/operator-binary/src/discovery.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index 7691c0fc..289b4b04 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -65,7 +65,7 @@ pub enum Error { }, } -/// Builds discovery [`ConfigMap`]s for connecting to a [`v1alpha1::ZookeeperCluster`] for all expected scenarios +/// Builds discovery [`ConfigMap`]s for connecting to a [`crate::crd::v1alpha1::ZookeeperCluster`] for all expected scenarios #[allow(clippy::too_many_arguments)] pub async fn build_discovery_configmaps( zk: &ZookeeperCluster, @@ -110,7 +110,7 @@ pub async fn build_discovery_configmaps( Ok(discovery_configmaps) } -/// Build a discovery [`ConfigMap`] containing information about how to connect to a certain [`v1alpha1::ZookeeperCluster`] +/// Build a discovery [`ConfigMap`] containing information about how to connect to a certain [`crate::crd::v1alpha1::ZookeeperCluster`] /// /// `hosts` will usually come from either [`pod_hosts`] or [`nodeport_hosts`]. #[allow(clippy::too_many_arguments)] @@ -171,7 +171,7 @@ fn build_discovery_configmap( .context(BuildConfigMapSnafu) } -/// Lists all Pods FQDNs expected to host the [`v1alpha1::ZookeeperCluster`] +/// Lists all Pods FQDNs expected to host the [`crate::crd::v1alpha1::ZookeeperCluster`] fn pod_hosts<'a>( zk: &'a ZookeeperCluster, zookeeper_security: &'a ZookeeperSecurity, From a9b047577d47f362fe1a04d50b3ec4be51a454a7 Mon Sep 17 00:00:00 2001 From: xeniape Date: Wed, 12 Feb 2025 11:07:50 +0100 Subject: [PATCH 07/11] chore: version the crd --- rust/operator-binary/src/crd/affinity.rs | 2 +- .../operator-binary/src/crd/authentication.rs | 32 ++-- rust/operator-binary/src/crd/mod.rs | 175 +++++++++--------- rust/operator-binary/src/crd/tls.rs | 54 +++--- rust/operator-binary/src/discovery.rs | 5 +- rust/operator-binary/src/operations/pdb.rs | 5 +- rust/operator-binary/src/product_logging.rs | 4 +- rust/operator-binary/src/zk_controller.rs | 11 +- 8 files changed, 145 insertions(+), 143 deletions(-) diff --git a/rust/operator-binary/src/crd/affinity.rs b/rust/operator-binary/src/crd/affinity.rs index 95d40db8..d33f815d 100644 --- a/rust/operator-binary/src/crd/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -3,7 +3,7 @@ use stackable_operator::{ k8s_openapi::api::core::v1::PodAntiAffinity, }; -use crate::crd::{v1alpha1::ZookeeperRole, APP_NAME}; +use crate::crd::{ZookeeperRole, APP_NAME}; pub fn get_affinity(cluster_name: &str, role: &ZookeeperRole) -> StackableAffinityFragment { let affinity_between_role_pods = diff --git a/rust/operator-binary/src/crd/authentication.rs b/rust/operator-binary/src/crd/authentication.rs index 0af304eb..12a74d42 100644 --- a/rust/operator-binary/src/crd/authentication.rs +++ b/rust/operator-binary/src/crd/authentication.rs @@ -5,6 +5,7 @@ use stackable_operator::{ commons::authentication::{AuthenticationClass, AuthenticationClassProvider}, schemars::{self, JsonSchema}, }; +use stackable_versioned::versioned; use crate::crd::ObjectRef; @@ -29,19 +30,22 @@ pub enum Error { }, } -#[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperAuthentication { - /// The [AuthenticationClass](https://docs.stackable.tech/home/stable/concepts/authentication) to use. - /// - /// ## mTLS - /// - /// Only affects client connections. This setting controls: - /// - If clients need to authenticate themselves against the server via TLS - /// - Which ca.crt to use when validating the provided client certs - /// - /// This will override the server TLS settings (if set) in `spec.clusterConfig.tls.serverSecretClass`. - pub authentication_class: String, +#[versioned(version(name = "v1alpha1"))] +pub mod versioned { + #[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperAuthentication { + /// The [AuthenticationClass](https://docs.stackable.tech/home/stable/concepts/authentication) to use. + /// + /// ## mTLS + /// + /// Only affects client connections. This setting controls: + /// - If clients need to authenticate themselves against the server via TLS + /// - Which ca.crt to use when validating the provided client certs + /// + /// This will override the server TLS settings (if set) in `spec.clusterConfig.tls.serverSecretClass`. + pub authentication_class: String, + } } #[derive(Clone, Debug)] @@ -99,7 +103,7 @@ impl ResolvedAuthenticationClasses { /// - Validation failed pub async fn resolve_authentication_classes( client: &Client, - auth_classes: &Vec, + auth_classes: &Vec, ) -> Result { let mut resolved_authentication_classes: Vec = vec![]; diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 2a070733..97213893 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -37,7 +37,8 @@ use stackable_versioned::versioned; use strum::{Display, EnumIter, EnumString, IntoEnumIterator}; use crate::crd::{ - affinity::get_affinity, authentication::ZookeeperAuthentication, tls::ZookeeperTls, + affinity::get_affinity, authentication::v1alpha1::ZookeeperAuthentication, + tls::v1alpha1::ZookeeperTls, }; pub mod affinity; @@ -143,7 +144,7 @@ pub mod versioned { /// Settings that affect all roles and role groups. /// The settings in the `clusterConfig` are cluster wide settings that do not need to be configurable at role or role group level. #[serde(default = "cluster_config_default")] - pub cluster_config: v1alpha1::ZookeeperClusterConfig, + pub cluster_config: ZookeeperClusterConfig, // no doc - it's in the struct. #[serde(default)] pub cluster_operation: ClusterOperation, @@ -187,7 +188,7 @@ pub mod versioned { /// In the future, this setting will control which [ListenerClass](DOCS_BASE_URL_PLACEHOLDER/listener-operator/listenerclass.html) /// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change. #[serde(default)] - pub listener_class: v1alpha1::CurrentlySupportedListenerClasses, + pub listener_class: CurrentlySupportedListenerClasses, } // TODO: Temporary solution until listener-operator is finished @@ -201,45 +202,6 @@ pub mod versioned { ExternalUnstable, } - #[derive(Clone, Debug, Default, JsonSchema, PartialEq, Fragment)] - #[fragment_attrs( - derive( - Clone, - Debug, - Default, - Deserialize, - Merge, - JsonSchema, - PartialEq, - Serialize - ), - serde(rename_all = "camelCase") - )] - pub struct ZookeeperStorageConfig { - #[fragment_attrs(serde(default))] - pub data: PvcConfig, - } - - #[derive( - Clone, - Debug, - Deserialize, - Display, - Eq, - EnumIter, - JsonSchema, - Ord, - PartialEq, - PartialOrd, - Serialize, - )] - #[serde(rename_all = "camelCase")] - pub enum Container { - Prepare, - Vector, - Zookeeper, - } - #[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)] #[fragment_attrs( derive( @@ -261,10 +223,10 @@ pub mod versioned { pub myid_offset: u16, #[fragment_attrs(serde(default))] - pub resources: Resources, + pub resources: Resources, #[fragment_attrs(serde(default))] - pub logging: Logging, + pub logging: Logging, #[fragment_attrs(serde(default))] pub affinity: StackableAffinity, @@ -279,23 +241,43 @@ pub mod versioned { pub requested_secret_lifetime: Option, } + #[derive(Clone, Debug, Default, JsonSchema, PartialEq, Fragment)] + #[fragment_attrs( + derive( + Clone, + Debug, + Default, + Deserialize, + Merge, + JsonSchema, + PartialEq, + Serialize + ), + serde(rename_all = "camelCase") + )] + pub struct ZookeeperStorageConfig { + #[fragment_attrs(serde(default))] + pub data: PvcConfig, + } + #[derive( Clone, Debug, Deserialize, Display, - EnumIter, Eq, - Hash, + EnumIter, JsonSchema, + Ord, PartialEq, + PartialOrd, Serialize, - EnumString, )] - #[strum(serialize_all = "camelCase")] - pub enum ZookeeperRole { - #[strum(serialize = "server")] - Server, + #[serde(rename_all = "camelCase")] + pub enum Container { + Prepare, + Vector, + Zookeeper, } #[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] @@ -308,16 +290,6 @@ pub mod versioned { pub conditions: Vec, } - /// Reference to a single `Pod` that is a component of a [`v1alpha1::ZookeeperCluster`] - /// - /// Used for service discovery. - pub struct ZookeeperPodRef { - pub namespace: String, - pub role_group_service_name: String, - pub pod_name: String, - pub zookeeper_myid: u16, - } - /// A claim for a single ZooKeeper ZNode tree (filesystem node). /// /// A ConfigMap will automatically be created with the same name, containing the connection string in the field `ZOOKEEPER`. @@ -330,12 +302,13 @@ pub mod versioned { /// You can learn more about this in the /// [Isolating clients with ZNodes usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/isolating_clients_with_znodes). #[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] - #[kube( + #[versioned(k8s( group = "zookeeper.stackable.tech", - version = "v1alpha1", kind = "ZookeeperZnode", plural = "zookeeperznodes", - shortname = "zno", + // TODO: stackable-versioned currently only supports a single shortname. + // Leaving this one commented for now. + // shortname = "zno", shortname = "znode", status = "ZookeeperZnodeStatus", namespaced, @@ -344,7 +317,7 @@ pub mod versioned { k8s_openapi = "stackable_operator::k8s_openapi", schemars = "stackable_operator::schemars" ) - )] + ))] #[serde(rename_all = "camelCase")] pub struct ZookeeperZnodeSpec { /// The reference to the ZookeeperCluster that this ZNode belongs to. @@ -362,6 +335,35 @@ pub mod versioned { } } +#[derive( + Clone, + Debug, + Deserialize, + Display, + EnumIter, + Eq, + Hash, + JsonSchema, + PartialEq, + Serialize, + EnumString, +)] +#[strum(serialize_all = "camelCase")] +pub enum ZookeeperRole { + #[strum(serialize = "server")] + Server, +} + +/// Reference to a single `Pod` that is a component of a [`v1alpha1::ZookeeperCluster`] +/// +/// Used for service discovery. +pub struct ZookeeperPodRef { + pub namespace: String, + pub role_group_service_name: String, + pub pod_name: String, + pub zookeeper_myid: u16, +} + fn cluster_config_default() -> v1alpha1::ZookeeperClusterConfig { v1alpha1::ZookeeperClusterConfig { authentication: vec![], @@ -394,7 +396,7 @@ impl v1alpha1::ZookeeperConfig { fn default_server_config( cluster_name: &str, - role: &v1alpha1::ZookeeperRole, + role: &ZookeeperRole, ) -> v1alpha1::ZookeeperConfigFragment { v1alpha1::ZookeeperConfigFragment { init_limit: None, @@ -451,7 +453,7 @@ impl Configuration for v1alpha1::ZookeeperConfigFragment { self.myid_offset .or(v1alpha1::ZookeeperConfig::default_server_config( &resource.name_any(), - &v1alpha1::ZookeeperRole::Server, + &ZookeeperRole::Server, ) .myid_offset) .map(|myid_offset| myid_offset.to_string()), @@ -508,7 +510,7 @@ impl Configuration for v1alpha1::ZookeeperConfigFragment { } } -impl v1alpha1::ZookeeperRole { +impl ZookeeperRole { pub fn roles() -> Vec { let mut roles = vec![]; for role in Self::iter() { @@ -527,7 +529,7 @@ impl HasStatusCondition for v1alpha1::ZookeeperCluster { } } -impl v1alpha1::ZookeeperPodRef { +impl ZookeeperPodRef { pub fn fqdn(&self, cluster_info: &KubernetesClusterInfo) -> String { format!( "{pod_name}.{service_name}.{namespace}.svc.{cluster_domain}", @@ -581,10 +583,10 @@ impl v1alpha1::ZookeeperCluster { /// Returns a reference to the role. Raises an error if the role is not defined. pub fn role( &self, - role_variant: &v1alpha1::ZookeeperRole, + role_variant: &ZookeeperRole, ) -> Result<&Role, Error> { match role_variant { - v1alpha1::ZookeeperRole::Server => self.spec.servers.as_ref(), + ZookeeperRole::Server => self.spec.servers.as_ref(), } .with_context(|| CannotRetrieveZookeeperRoleSnafu { role: role_variant.to_string(), @@ -599,13 +601,12 @@ impl v1alpha1::ZookeeperCluster { RoleGroup, Error, > { - let role_variant = - v1alpha1::ZookeeperRole::from_str(&rolegroup_ref.role).with_context(|_| { - UnknownZookeeperRoleSnafu { - role: rolegroup_ref.role.to_owned(), - roles: v1alpha1::ZookeeperRole::roles(), - } - })?; + let role_variant = ZookeeperRole::from_str(&rolegroup_ref.role).with_context(|_| { + UnknownZookeeperRoleSnafu { + role: rolegroup_ref.role.to_owned(), + roles: ZookeeperRole::roles(), + } + })?; let role = self.role(&role_variant)?; role.role_groups .get(&rolegroup_ref.role_group) @@ -622,14 +623,14 @@ impl v1alpha1::ZookeeperCluster { ) -> RoleGroupRef { RoleGroupRef { cluster: ObjectRef::from_obj(self), - role: v1alpha1::ZookeeperRole::Server.to_string(), + role: ZookeeperRole::Server.to_string(), role_group: group_name.into(), } } - pub fn role_config(&self, role: &v1alpha1::ZookeeperRole) -> Option<&GenericRoleConfig> { + pub fn role_config(&self, role: &ZookeeperRole) -> Option<&GenericRoleConfig> { match role { - v1alpha1::ZookeeperRole::Server => self.spec.servers.as_ref().map(|s| &s.role_config), + ZookeeperRole::Server => self.spec.servers.as_ref().map(|s| &s.role_config), } } @@ -639,7 +640,7 @@ impl v1alpha1::ZookeeperCluster { /// avoid instance churn. For example, regenerating zoo.cfg based on the cluster state would lead to /// a lot of spurious restarts, as well as opening us up to dangerous split-brain conditions because /// the pods have inconsistent snapshots of which servers they should expect to be in quorum. - pub fn pods(&self) -> Result + '_, Error> { + pub fn pods(&self) -> Result + '_, Error> { let ns = self.metadata.namespace.clone().context(NoNamespaceSnafu)?; let role_groups = self .spec @@ -652,12 +653,12 @@ impl v1alpha1::ZookeeperCluster { for (rolegroup_name, rolegroup) in role_groups { let rolegroup_ref = self.server_rolegroup_ref(rolegroup_name); let myid_offset = self - .merged_config(&v1alpha1::ZookeeperRole::Server, &rolegroup_ref)? + .merged_config(&ZookeeperRole::Server, &rolegroup_ref)? .myid_offset; let ns = ns.clone(); // In case no replicas are specified we default to 1 for i in 0..rolegroup.replicas.unwrap_or(1) { - pod_refs.push(v1alpha1::ZookeeperPodRef { + pod_refs.push(ZookeeperPodRef { namespace: ns.clone(), role_group_service_name: rolegroup_ref.object_name(), pod_name: format!("{}-{}", rolegroup_ref.object_name(), i), @@ -670,7 +671,7 @@ impl v1alpha1::ZookeeperCluster { pub fn merged_config( &self, - role: &v1alpha1::ZookeeperRole, + role: &ZookeeperRole, rolegroup_ref: &RoleGroupRef, ) -> Result { // Initialize the result with all default values as baseline @@ -698,7 +699,7 @@ impl v1alpha1::ZookeeperCluster { pub fn logging( &self, - role: &v1alpha1::ZookeeperRole, + role: &ZookeeperRole, rolegroup_ref: &RoleGroupRef, ) -> Result, Error> { let config = self.merged_config(role, rolegroup_ref)?; @@ -713,7 +714,7 @@ impl v1alpha1::ZookeeperCluster { /// 3. a default PVC with 1Gi capacity pub fn resources( &self, - role: &v1alpha1::ZookeeperRole, + role: &ZookeeperRole, rolegroup_ref: &RoleGroupRef, ) -> Result<(Vec, ResourceRequirements), Error> { let config = self.merged_config(role, rolegroup_ref)?; diff --git a/rust/operator-binary/src/crd/tls.rs b/rust/operator-binary/src/crd/tls.rs index 01d5a920..50e769fe 100644 --- a/rust/operator-binary/src/crd/tls.rs +++ b/rust/operator-binary/src/crd/tls.rs @@ -1,37 +1,41 @@ use serde::{Deserialize, Serialize}; use stackable_operator::schemars::{self, JsonSchema}; +use stackable_versioned::versioned; const TLS_DEFAULT_SECRET_CLASS: &str = "tls"; -#[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct ZookeeperTls { - /// The [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) to use for - /// internal quorum communication. Use mutual verification between Zookeeper Nodes - /// (mandatory). This setting controls: - /// - Which cert the servers should use to authenticate themselves against other servers - /// - Which ca.crt to use when validating the other server - /// - /// Defaults to `tls` - #[serde(default = "quorum_tls_default")] - pub quorum_secret_class: String, +#[versioned(version(name = "v1alpha1"))] +pub mod versioned { + #[derive(Clone, Deserialize, Debug, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct ZookeeperTls { + /// The [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) to use for + /// internal quorum communication. Use mutual verification between Zookeeper Nodes + /// (mandatory). This setting controls: + /// - Which cert the servers should use to authenticate themselves against other servers + /// - Which ca.crt to use when validating the other server + /// + /// Defaults to `tls` + #[serde(default = "quorum_tls_default")] + pub quorum_secret_class: String, - /// The [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) to use for - /// client connections. This setting controls: - /// - If TLS encryption is used at all - /// - Which cert the servers should use to authenticate themselves against the client - /// - /// Defaults to `tls`. - #[serde( - default = "server_tls_default", - skip_serializing_if = "Option::is_none" - )] - pub server_secret_class: Option, + /// The [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) to use for + /// client connections. This setting controls: + /// - If TLS encryption is used at all + /// - Which cert the servers should use to authenticate themselves against the client + /// + /// Defaults to `tls`. + #[serde( + default = "server_tls_default", + skip_serializing_if = "Option::is_none" + )] + pub server_secret_class: Option, + } } /// Default TLS settings. Internal and server communication default to "tls" secret class. -pub fn default_zookeeper_tls() -> Option { - Some(ZookeeperTls { +pub fn default_zookeeper_tls() -> Option { + Some(v1alpha1::ZookeeperTls { quorum_secret_class: quorum_tls_default(), server_secret_class: server_tls_default(), }) diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index 289b4b04..329c6320 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -10,10 +10,7 @@ use stackable_operator::{ }; use crate::{ - crd::{ - security::ZookeeperSecurity, - v1alpha1::{ZookeeperCluster, ZookeeperRole}, - }, + crd::{security::ZookeeperSecurity, v1alpha1::ZookeeperCluster, ZookeeperRole}, utils::build_recommended_labels, }; diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index a4e0752e..e09d6bca 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -5,10 +5,7 @@ use stackable_operator::{ }; use crate::{ - crd::{ - v1alpha1::{ZookeeperCluster, ZookeeperRole}, - APP_NAME, OPERATOR_NAME, - }, + crd::{v1alpha1::ZookeeperCluster, ZookeeperRole, APP_NAME, OPERATOR_NAME}, zk_controller::ZK_CONTROLLER_NAME, }; diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index 4f6b97e7..2233e115 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -13,8 +13,8 @@ use stackable_operator::{ }; use crate::crd::{ - v1alpha1::{Container, ZookeeperCluster, ZookeeperRole}, - LoggingFramework, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, + v1alpha1::{Container, ZookeeperCluster}, + LoggingFramework, ZookeeperRole, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, }; diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index db5c463a..554f126c 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -70,12 +70,11 @@ use crate::{ command::create_init_container_command_args, crd::{ security::{self, ZookeeperSecurity}, - v1alpha1::{ - Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig, ZookeeperRole, - }, - DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, MAX_PREPARE_LOG_FILE_SIZE, - MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, - STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, + v1alpha1::{Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig}, + ZookeeperRole, DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, + MAX_PREPARE_LOG_FILE_SIZE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, + STACKABLE_LOG_CONFIG_DIR, STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, + ZOOKEEPER_PROPERTIES_FILE, }, discovery::{self, build_discovery_configmaps}, operations::{graceful_shutdown::add_graceful_shutdown_config, pdb::add_pdbs}, From d3811555701d459a6211b143f3f2a94e25d034c1 Mon Sep 17 00:00:00 2001 From: xeniape Date: Wed, 12 Feb 2025 11:19:21 +0100 Subject: [PATCH 08/11] regenerate-charts --- deploy/helm/zookeeper-operator/crds/crds.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/deploy/helm/zookeeper-operator/crds/crds.yaml b/deploy/helm/zookeeper-operator/crds/crds.yaml index 82389036..d8c9eb00 100644 --- a/deploy/helm/zookeeper-operator/crds/crds.yaml +++ b/deploy/helm/zookeeper-operator/crds/crds.yaml @@ -789,7 +789,6 @@ spec: kind: ZookeeperZnode plural: zookeeperznodes shortNames: - - zno - znode singular: zookeeperznode scope: Namespaced From a5cc9fb7bddc044e0958d26325234f569d2e7c78 Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 17 Feb 2025 15:01:50 +0100 Subject: [PATCH 09/11] bump stackable-versioned, refactor imports and version references --- Cargo.lock | 261 +---- Cargo.nix | 981 ++---------------- Cargo.toml | 2 +- crate-hashes.json | 6 +- deploy/helm/zookeeper-operator/crds/crds.yaml | 1 + rust/operator-binary/src/crd/affinity.rs | 5 +- rust/operator-binary/src/crd/mod.rs | 13 +- rust/operator-binary/src/crd/security.rs | 6 +- rust/operator-binary/src/discovery.rs | 10 +- rust/operator-binary/src/main.rs | 16 +- .../src/operations/graceful_shutdown.rs | 4 +- rust/operator-binary/src/operations/pdb.rs | 4 +- rust/operator-binary/src/product_logging.rs | 15 +- rust/operator-binary/src/zk_controller.rs | 47 +- rust/operator-binary/src/znode_controller.rs | 49 +- 15 files changed, 215 insertions(+), 1205 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 54802182..a652fbb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,12 +220,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.8.0" @@ -376,9 +370,9 @@ dependencies = [ [[package]] name = "convert_case" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" dependencies = [ "unicode-segmentation", ] @@ -639,15 +633,6 @@ dependencies = [ "regex-syntax 0.8.5", ] -[[package]] -name = "fluent-uri" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "fnv" version = "1.0.7" @@ -798,7 +783,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ - "bitflags 2.8.0", + "bitflags", "libc", "libgit2-sys", "log", @@ -811,16 +796,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hashbrown" version = "0.15.2" @@ -1199,7 +1174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -1231,9 +1206,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -1274,45 +1249,18 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json-patch" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" -dependencies = [ - "jsonptr 0.4.7", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "json-patch" version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" dependencies = [ - "jsonptr 0.6.3", + "jsonptr", "serde", "serde_json", "thiserror 1.0.69", ] -[[package]] -name = "jsonpath-rust" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d8fe85bd70ff715f31ce8c739194b423d79811a19602115d611a3ec85d6200" -dependencies = [ - "lazy_static", - "once_cell", - "pest", - "pest_derive", - "regex", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "jsonpath-rust" version = "0.7.5" @@ -1326,17 +1274,6 @@ dependencies = [ "thiserror 2.0.11", ] -[[package]] -name = "jsonptr" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" -dependencies = [ - "fluent-uri", - "serde", - "serde_json", -] - [[package]] name = "jsonptr" version = "0.6.3" @@ -1347,20 +1284,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "k8s-openapi" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8847402328d8301354c94d605481f25a6bdc1ed65471fd96af8eca71141b13" -dependencies = [ - "base64 0.22.1", - "chrono", - "schemars", - "serde", - "serde-value", - "serde_json", -] - [[package]] name = "k8s-openapi" version = "0.24.0" @@ -1378,75 +1301,24 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#048c7d8befddc2f2c6414444006871c95412d67c" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.1#c07fd5d7237b0774b6bf4c8f3878df3b59b4ec07" dependencies = [ "darling", "regex", "snafu 0.8.5", ] -[[package]] -name = "kube" -version = "0.96.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efffeb3df0bd4ef3e5d65044573499c0e4889b988070b08c50b25b1329289a1f" -dependencies = [ - "k8s-openapi 0.23.0", - "kube-client 0.96.0", - "kube-core 0.96.0", - "kube-derive 0.96.0", - "kube-runtime 0.96.0", -] - [[package]] name = "kube" version = "0.98.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32053dc495efad4d188c7b33cc7c02ef4a6e43038115348348876efd39a53cba" dependencies = [ - "k8s-openapi 0.24.0", - "kube-client 0.98.0", - "kube-core 0.98.0", - "kube-derive 0.98.0", - "kube-runtime 0.98.0", -] - -[[package]] -name = "kube-client" -version = "0.96.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf471ece8ff8d24735ce78dac4d091e9fcb8d74811aeb6b75de4d1c3f5de0f1" -dependencies = [ - "base64 0.22.1", - "bytes", - "chrono", - "either", - "futures 0.3.31", - "home", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-http-proxy", - "hyper-rustls", - "hyper-timeout", - "hyper-util", - "jsonpath-rust 0.5.1", - "k8s-openapi 0.23.0", - "kube-core 0.96.0", - "pem", - "rustls", - "rustls-pemfile", - "secrecy", - "serde", - "serde_json", - "serde_yaml", - "thiserror 1.0.69", - "tokio", - "tokio-util", - "tower", - "tower-http", - "tracing", + "k8s-openapi", + "kube-client", + "kube-core", + "kube-derive", + "kube-runtime", ] [[package]] @@ -1469,9 +1341,9 @@ dependencies = [ "hyper-rustls", "hyper-timeout", "hyper-util", - "jsonpath-rust 0.7.5", - "k8s-openapi 0.24.0", - "kube-core 0.98.0", + "jsonpath-rust", + "k8s-openapi", + "kube-core", "pem", "rustls", "rustls-pemfile", @@ -1487,24 +1359,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "kube-core" -version = "0.96.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f42346d30bb34d1d7adc5c549b691bce7aa3a1e60254e68fab7e2d7b26fe3d77" -dependencies = [ - "chrono", - "form_urlencoded", - "http", - "json-patch 2.0.0", - "k8s-openapi 0.23.0", - "schemars", - "serde", - "serde-value", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "kube-core" version = "0.98.0" @@ -1514,8 +1368,8 @@ dependencies = [ "chrono", "form_urlencoded", "http", - "json-patch 3.0.1", - "k8s-openapi 0.24.0", + "json-patch", + "k8s-openapi", "schemars", "serde", "serde-value", @@ -1523,19 +1377,6 @@ dependencies = [ "thiserror 2.0.11", ] -[[package]] -name = "kube-derive" -version = "0.96.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9364e04cc5e0482136c6ee8b7fb7551812da25802249f35b3def7aaa31e82ad" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.96", -] - [[package]] name = "kube-derive" version = "0.98.0" @@ -1549,34 +1390,6 @@ dependencies = [ "syn 2.0.96", ] -[[package]] -name = "kube-runtime" -version = "0.96.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fbf1f6ffa98e65f1d2a9a69338bb60605d46be7edf00237784b89e62c9bd44" -dependencies = [ - "ahash", - "async-broadcast", - "async-stream", - "async-trait", - "backoff", - "educe", - "futures 0.3.31", - "hashbrown 0.14.5", - "json-patch 2.0.0", - "jsonptr 0.4.7", - "k8s-openapi 0.23.0", - "kube-client 0.96.0", - "parking_lot", - "pin-project", - "serde", - "serde_json", - "thiserror 1.0.69", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "kube-runtime" version = "0.98.0" @@ -1590,12 +1403,12 @@ dependencies = [ "backoff", "educe", "futures 0.3.31", - "hashbrown 0.15.2", + "hashbrown", "hostname", - "json-patch 3.0.1", - "jsonptr 0.6.3", - "k8s-openapi 0.24.0", - "kube-client 0.98.0", + "json-patch", + "jsonptr", + "k8s-openapi", + "kube-client", "parking_lot", "pin-project", "serde", @@ -2056,7 +1869,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.8.0", + "bitflags", ] [[package]] @@ -2257,7 +2070,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -2270,7 +2083,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.8.0", + "bitflags", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -2498,9 +2311,9 @@ dependencies = [ "either", "futures 0.3.31", "indexmap", - "json-patch 3.0.1", - "k8s-openapi 0.24.0", - "kube 0.98.0", + "json-patch", + "k8s-openapi", + "kube", "opentelemetry-jaeger", "opentelemetry_sdk", "product-config", @@ -2538,7 +2351,7 @@ name = "stackable-shared" version = "0.0.1" source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#59506c6202778889a27b6ae8153457e60a49c68d" dependencies = [ - "kube 0.98.0", + "kube", "semver", "serde", "serde_yaml", @@ -2547,23 +2360,23 @@ dependencies = [ [[package]] name = "stackable-versioned" -version = "0.5.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#048c7d8befddc2f2c6414444006871c95412d67c" +version = "0.5.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.1#c07fd5d7237b0774b6bf4c8f3878df3b59b4ec07" dependencies = [ "stackable-versioned-macros", ] [[package]] name = "stackable-versioned-macros" -version = "0.5.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#048c7d8befddc2f2c6414444006871c95412d67c" +version = "0.5.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.1#c07fd5d7237b0774b6bf4c8f3878df3b59b4ec07" dependencies = [ "convert_case", "darling", "itertools", - "k8s-openapi 0.23.0", + "k8s-openapi", "k8s-version", - "kube 0.96.0", + "kube", "proc-macro2", "quote", "syn 2.0.96", @@ -2885,7 +2698,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ "base64 0.22.1", - "bitflags 2.8.0", + "bitflags", "bytes", "http", "http-body", diff --git a/Cargo.nix b/Cargo.nix index 411b813d..1807e280 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -657,22 +657,7 @@ rec { }; resolvedDefaultFeatures = [ "std" ]; }; - "bitflags 1.3.2" = rec { - crateName = "bitflags"; - version = "1.3.2"; - edition = "2018"; - sha256 = "12ki6w8gn1ldq7yz9y680llwk5gmrhrzszaa17g1sbrw2r2qvwxy"; - authors = [ - "The Rust Project Developers" - ]; - features = { - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "rustc-dep-of-std" = [ "core" "compiler_builtins" ]; - }; - resolvedDefaultFeatures = [ "default" ]; - }; - "bitflags 2.8.0" = rec { + "bitflags" = rec { crateName = "bitflags"; version = "2.8.0"; edition = "2021"; @@ -1105,11 +1090,11 @@ rec { }; "convert_case" = rec { crateName = "convert_case"; - version = "0.6.0"; - edition = "2018"; - sha256 = "1jn1pq6fp3rri88zyw6jlhwwgf6qiyc08d6gjv0qypgkl862n67c"; + version = "0.7.1"; + edition = "2021"; + sha256 = "1rzih8qbd3xh87wp76nkjvnrimn7vlzcwl2n88898ml59j6jnh5v"; authors = [ - "Rutrum " + "rutrum " ]; dependencies = [ { @@ -1803,26 +1788,6 @@ rec { }; resolvedDefaultFeatures = [ "default" "perf" "std" "unicode" ]; }; - "fluent-uri" = rec { - crateName = "fluent-uri"; - version = "0.1.4"; - edition = "2021"; - sha256 = "03ah2qajw5l1zbc81kh1n8g7n24mfxbg6vqyv9ixipg1vglh9iqp"; - libName = "fluent_uri"; - authors = [ - "Scallop Ye " - ]; - dependencies = [ - { - name = "bitflags"; - packageId = "bitflags 1.3.2"; - } - ]; - features = { - "default" = [ "std" ]; - }; - resolvedDefaultFeatures = [ "std" ]; - }; "fnv" = rec { crateName = "fnv"; version = "1.0.7"; @@ -2261,7 +2226,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags 2.8.0"; + packageId = "bitflags"; } { name = "libc"; @@ -2302,46 +2267,7 @@ rec { ]; }; - "hashbrown 0.14.5" = rec { - crateName = "hashbrown"; - version = "0.14.5"; - edition = "2021"; - sha256 = "1wa1vy1xs3mp11bn3z9dv0jricgr6a2j0zkf1g19yz3vw4il89z5"; - authors = [ - "Amanieu d'Antras " - ]; - dependencies = [ - { - name = "ahash"; - packageId = "ahash"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "allocator-api2"; - packageId = "allocator-api2"; - optional = true; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - ]; - features = { - "ahash" = [ "dep:ahash" ]; - "alloc" = [ "dep:alloc" ]; - "allocator-api2" = [ "dep:allocator-api2" ]; - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "default" = [ "ahash" "inline-more" "allocator-api2" ]; - "equivalent" = [ "dep:equivalent" ]; - "nightly" = [ "allocator-api2?/nightly" "bumpalo/allocator_api" ]; - "rayon" = [ "dep:rayon" ]; - "rkyv" = [ "dep:rkyv" ]; - "rustc-dep-of-std" = [ "nightly" "core" "compiler_builtins" "alloc" "rustc-internal-api" ]; - "serde" = [ "dep:serde" ]; - }; - resolvedDefaultFeatures = [ "ahash" "allocator-api2" "default" "inline-more" ]; - }; - "hashbrown 0.15.2" = rec { + "hashbrown" = rec { crateName = "hashbrown"; version = "0.15.2"; edition = "2021"; @@ -3611,7 +3537,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown 0.15.2"; + packageId = "hashbrown"; usesDefaultFeatures = false; } ]; @@ -3687,9 +3613,9 @@ rec { }; "itertools" = rec { crateName = "itertools"; - version = "0.13.0"; + version = "0.14.0"; edition = "2018"; - sha256 = "11hiy3qzl643zcigknclh446qb9zlg4dpdzfkjaa9q9fqpgyfgj1"; + sha256 = "118j6l1vs2mx65dqhwyssbrxpawa90886m3mzafdvyip41w2q69b"; authors = [ "bluss" ]; @@ -3787,48 +3713,7 @@ rec { }; resolvedDefaultFeatures = [ "default" "std" ]; }; - "json-patch 2.0.0" = rec { - crateName = "json-patch"; - version = "2.0.0"; - edition = "2021"; - sha256 = "1z1h6dyy4lx4z74yby2hvgl4jbm8mh5ymjp6fwcdkyi3923bh7sv"; - libName = "json_patch"; - authors = [ - "Ivan Dubrov " - ]; - dependencies = [ - { - name = "jsonptr"; - packageId = "jsonptr 0.4.7"; - } - { - name = "serde"; - packageId = "serde"; - features = [ "derive" ]; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "thiserror"; - packageId = "thiserror 1.0.69"; - } - ]; - devDependencies = [ - { - name = "serde_json"; - packageId = "serde_json"; - features = [ "preserve_order" ]; - } - ]; - features = { - "default" = [ "diff" ]; - "utoipa" = [ "dep:utoipa" ]; - }; - resolvedDefaultFeatures = [ "default" "diff" ]; - }; - "json-patch 3.0.1" = rec { + "json-patch" = rec { crateName = "json-patch"; version = "3.0.1"; edition = "2021"; @@ -3840,7 +3725,7 @@ rec { dependencies = [ { name = "jsonptr"; - packageId = "jsonptr 0.6.3"; + packageId = "jsonptr"; } { name = "serde"; @@ -3869,48 +3754,7 @@ rec { }; resolvedDefaultFeatures = [ "default" "diff" ]; }; - "jsonpath-rust 0.5.1" = rec { - crateName = "jsonpath-rust"; - version = "0.5.1"; - edition = "2018"; - sha256 = "0032bp43w6k1bl8h55m126cdf8xljj8p736f65gp3zvhpn2zxn0r"; - libName = "jsonpath_rust"; - authors = [ - "BorisZhguchev " - ]; - dependencies = [ - { - name = "lazy_static"; - packageId = "lazy_static"; - } - { - name = "once_cell"; - packageId = "once_cell"; - } - { - name = "pest"; - packageId = "pest"; - } - { - name = "pest_derive"; - packageId = "pest_derive"; - } - { - name = "regex"; - packageId = "regex"; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "thiserror"; - packageId = "thiserror 1.0.69"; - } - ]; - - }; - "jsonpath-rust 0.7.5" = rec { + "jsonpath-rust" = rec { crateName = "jsonpath-rust"; version = "0.7.5"; edition = "2021"; @@ -3943,44 +3787,7 @@ rec { ]; }; - "jsonptr 0.4.7" = rec { - crateName = "jsonptr"; - version = "0.4.7"; - edition = "2021"; - sha256 = "09s6bqjlkd1m5z9hi9iwjimiri7wx3fd6d88hara0p27968m4vhw"; - authors = [ - "chance dinkins" - ]; - dependencies = [ - { - name = "fluent-uri"; - packageId = "fluent-uri"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "serde"; - packageId = "serde"; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - { - name = "serde_json"; - packageId = "serde_json"; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - ]; - features = { - "default" = [ "std" ]; - "fluent-uri" = [ "dep:fluent-uri" ]; - "std" = [ "serde/std" "serde_json/std" "fluent-uri?/std" ]; - "uniresid" = [ "dep:uniresid" ]; - "url" = [ "dep:url" ]; - }; - resolvedDefaultFeatures = [ "default" "std" ]; - }; - "jsonptr 0.6.3" = rec { + "jsonptr" = rec { crateName = "jsonptr"; version = "0.6.3"; edition = "2021"; @@ -4014,60 +3821,7 @@ rec { }; resolvedDefaultFeatures = [ "assign" "default" "delete" "json" "resolve" "serde" "std" ]; }; - "k8s-openapi 0.23.0" = rec { - crateName = "k8s-openapi"; - version = "0.23.0"; - edition = "2021"; - links = "k8s-openapi-0.23.0"; - sha256 = "04qv2iqwm3mgjvyp2m6n3vf6nnpjh5a60kf9ah9k1n184d04g24w"; - libName = "k8s_openapi"; - authors = [ - "Arnav Singh " - ]; - dependencies = [ - { - name = "base64"; - packageId = "base64 0.22.1"; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - { - name = "chrono"; - packageId = "chrono"; - usesDefaultFeatures = false; - features = [ "alloc" "serde" ]; - } - { - name = "schemars"; - packageId = "schemars"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "serde"; - packageId = "serde"; - usesDefaultFeatures = false; - } - { - name = "serde-value"; - packageId = "serde-value"; - usesDefaultFeatures = false; - } - { - name = "serde_json"; - packageId = "serde_json"; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - ]; - features = { - "earliest" = [ "v1_26" ]; - "latest" = [ "v1_31" ]; - "schemars" = [ "dep:schemars" ]; - }; - resolvedDefaultFeatures = [ "schemars" "v1_31" ]; - }; - "k8s-openapi 0.24.0" = rec { + "k8s-openapi" = rec { crateName = "k8s-openapi"; version = "0.24.0"; edition = "2021"; @@ -4127,8 +3881,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "048c7d8befddc2f2c6414444006871c95412d67c"; - sha256 = "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6"; + rev = "c07fd5d7237b0774b6bf4c8f3878df3b59b4ec07"; + sha256 = "1l574x35z5ylidbc3qm0crp9qravhyry8i07ww3b1kpcr4w7dd53"; }; libName = "k8s_version"; authors = [ @@ -4154,11 +3908,11 @@ rec { }; resolvedDefaultFeatures = [ "darling" ]; }; - "kube 0.96.0" = rec { + "kube" = rec { crateName = "kube"; - version = "0.96.0"; + version = "0.98.0"; edition = "2021"; - sha256 = "07ws50li6nxja26b0w40k2dqir60k4s5fi2hsvjz6kmxy0yypzzg"; + sha256 = "1fiwllwzsvl7921k85c10d1nwjpg09ycqcvvihc4vbggjp23s19j"; authors = [ "clux " "Natalie Klestrup Röijezon " @@ -4167,380 +3921,66 @@ rec { dependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; } { name = "kube-client"; - packageId = "kube-client 0.96.0"; + packageId = "kube-client"; optional = true; usesDefaultFeatures = false; } { name = "kube-core"; - packageId = "kube-core 0.96.0"; + packageId = "kube-core"; } { name = "kube-derive"; - packageId = "kube-derive 0.96.0"; + packageId = "kube-derive"; optional = true; } { name = "kube-runtime"; - packageId = "kube-runtime 0.96.0"; + packageId = "kube-runtime"; optional = true; } ]; devDependencies = [ { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - features = [ "latest" ]; - } - ]; - features = { - "admission" = [ "kube-core/admission" ]; - "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; - "client" = [ "kube-client/client" "config" ]; - "config" = [ "kube-client/config" ]; - "default" = [ "client" "rustls-tls" ]; - "derive" = [ "kube-derive" "kube-core/schema" ]; - "gzip" = [ "kube-client/gzip" "client" ]; - "http-proxy" = [ "kube-client/http-proxy" "client" ]; - "jsonpatch" = [ "kube-core/jsonpatch" ]; - "kube-client" = [ "dep:kube-client" ]; - "kube-derive" = [ "dep:kube-derive" ]; - "kube-runtime" = [ "dep:kube-runtime" ]; - "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; - "oauth" = [ "kube-client/oauth" "client" ]; - "oidc" = [ "kube-client/oidc" "client" ]; - "openssl-tls" = [ "kube-client/openssl-tls" "client" ]; - "runtime" = [ "kube-runtime" ]; - "rustls-tls" = [ "kube-client/rustls-tls" "client" ]; - "socks5" = [ "kube-client/socks5" "client" ]; - "unstable-client" = [ "kube-client/unstable-client" "client" ]; - "unstable-runtime" = [ "kube-runtime/unstable-runtime" "runtime" ]; - "webpki-roots" = [ "kube-client/webpki-roots" "client" ]; - "ws" = [ "kube-client/ws" "kube-core/ws" ]; - }; - resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; - }; - "kube 0.98.0" = rec { - crateName = "kube"; - version = "0.98.0"; - edition = "2021"; - sha256 = "1fiwllwzsvl7921k85c10d1nwjpg09ycqcvvihc4vbggjp23s19j"; - authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " - ]; - dependencies = [ - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; - usesDefaultFeatures = false; - } - { - name = "kube-client"; - packageId = "kube-client 0.98.0"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "kube-core"; - packageId = "kube-core 0.98.0"; - } - { - name = "kube-derive"; - packageId = "kube-derive 0.98.0"; - optional = true; - } - { - name = "kube-runtime"; - packageId = "kube-runtime 0.98.0"; - optional = true; - } - ]; - devDependencies = [ - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; - usesDefaultFeatures = false; - features = [ "latest" ]; - } - ]; - features = { - "admission" = [ "kube-core/admission" ]; - "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; - "client" = [ "kube-client/client" "config" ]; - "config" = [ "kube-client/config" ]; - "default" = [ "client" "rustls-tls" ]; - "derive" = [ "kube-derive" "kube-core/schema" ]; - "gzip" = [ "kube-client/gzip" "client" ]; - "http-proxy" = [ "kube-client/http-proxy" "client" ]; - "jsonpatch" = [ "kube-core/jsonpatch" ]; - "kube-client" = [ "dep:kube-client" ]; - "kube-derive" = [ "dep:kube-derive" ]; - "kube-runtime" = [ "dep:kube-runtime" ]; - "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; - "oauth" = [ "kube-client/oauth" "client" ]; - "oidc" = [ "kube-client/oidc" "client" ]; - "openssl-tls" = [ "kube-client/openssl-tls" "client" ]; - "runtime" = [ "kube-runtime" ]; - "rustls-tls" = [ "kube-client/rustls-tls" "client" ]; - "socks5" = [ "kube-client/socks5" "client" ]; - "unstable-client" = [ "kube-client/unstable-client" "client" ]; - "unstable-runtime" = [ "kube-runtime/unstable-runtime" "runtime" ]; - "webpki-roots" = [ "kube-client/webpki-roots" "client" ]; - "ws" = [ "kube-client/ws" "kube-core/ws" ]; - }; - resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; - }; - "kube-client 0.96.0" = rec { - crateName = "kube-client"; - version = "0.96.0"; - edition = "2021"; - sha256 = "1wg0blziqkfyfmmyn6l1fj6wp7qy156sr3g7birj93gzx3n73x4b"; - libName = "kube_client"; - authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " - ]; - dependencies = [ - { - name = "base64"; - packageId = "base64 0.22.1"; - optional = true; - } - { - name = "bytes"; - packageId = "bytes"; - optional = true; - } - { - name = "chrono"; - packageId = "chrono"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "either"; - packageId = "either"; - optional = true; - } - { - name = "futures"; - packageId = "futures 0.3.31"; - optional = true; - usesDefaultFeatures = false; - features = [ "std" ]; - } - { - name = "home"; - packageId = "home"; - optional = true; - } - { - name = "http"; - packageId = "http"; - } - { - name = "http-body"; - packageId = "http-body"; - optional = true; - } - { - name = "http-body-util"; - packageId = "http-body-util"; - optional = true; - } - { - name = "hyper"; - packageId = "hyper"; - optional = true; - features = [ "client" "http1" ]; - } - { - name = "hyper-http-proxy"; - packageId = "hyper-http-proxy"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "hyper-rustls"; - packageId = "hyper-rustls"; - optional = true; - usesDefaultFeatures = false; - features = [ "http1" "logging" "native-tokio" "ring" "tls12" ]; - } - { - name = "hyper-timeout"; - packageId = "hyper-timeout"; - optional = true; - } - { - name = "hyper-util"; - packageId = "hyper-util"; - optional = true; - features = [ "client" "client-legacy" "http1" "tokio" ]; - } - { - name = "jsonpath-rust"; - packageId = "jsonpath-rust 0.5.1"; - optional = true; - } - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - } - { - name = "kube-core"; - packageId = "kube-core 0.96.0"; - } - { - name = "pem"; - packageId = "pem"; - optional = true; - } - { - name = "rustls"; - packageId = "rustls"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "rustls-pemfile"; - packageId = "rustls-pemfile"; - optional = true; - } - { - name = "secrecy"; - packageId = "secrecy"; - } - { - name = "serde"; - packageId = "serde"; - features = [ "derive" ]; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "serde_yaml"; - packageId = "serde_yaml"; - optional = true; - } - { - name = "thiserror"; - packageId = "thiserror 1.0.69"; - } - { - name = "tokio"; - packageId = "tokio"; - optional = true; - features = [ "time" "signal" "sync" ]; - } - { - name = "tokio-util"; - packageId = "tokio-util"; - optional = true; - features = [ "io" "codec" ]; - } - { - name = "tower"; - packageId = "tower"; - optional = true; - features = [ "buffer" "filter" "util" ]; - } - { - name = "tower-http"; - packageId = "tower-http"; - optional = true; - features = [ "auth" "map-response-body" "trace" ]; - } - { - name = "tracing"; - packageId = "tracing"; - optional = true; - features = [ "log" ]; - } - ]; - devDependencies = [ - { - name = "futures"; - packageId = "futures 0.3.31"; - usesDefaultFeatures = false; - features = [ "async-await" ]; - } - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - features = [ "latest" ]; - } - { - name = "tokio"; - packageId = "tokio"; - features = [ "full" ]; - } - ]; - features = { - "__non_core" = [ "tracing" "serde_yaml" "base64" ]; - "admission" = [ "kube-core/admission" ]; - "aws-lc-rs" = [ "rustls?/aws-lc-rs" ]; - "base64" = [ "dep:base64" ]; - "bytes" = [ "dep:bytes" ]; - "chrono" = [ "dep:chrono" ]; - "client" = [ "config" "__non_core" "hyper" "hyper-util" "http-body" "http-body-util" "tower" "tower-http" "hyper-timeout" "chrono" "jsonpath-rust" "bytes" "futures" "tokio" "tokio-util" "either" ]; - "config" = [ "__non_core" "pem" "home" ]; - "default" = [ "client" ]; - "either" = [ "dep:either" ]; - "form_urlencoded" = [ "dep:form_urlencoded" ]; - "futures" = [ "dep:futures" ]; - "gzip" = [ "client" "tower-http/decompression-gzip" ]; - "home" = [ "dep:home" ]; - "http-body" = [ "dep:http-body" ]; - "http-body-util" = [ "dep:http-body-util" ]; - "http-proxy" = [ "hyper-http-proxy" ]; - "hyper" = [ "dep:hyper" ]; - "hyper-http-proxy" = [ "dep:hyper-http-proxy" ]; - "hyper-openssl" = [ "dep:hyper-openssl" ]; - "hyper-rustls" = [ "dep:hyper-rustls" ]; - "hyper-socks2" = [ "dep:hyper-socks2" ]; - "hyper-timeout" = [ "dep:hyper-timeout" ]; - "hyper-util" = [ "dep:hyper-util" ]; - "jsonpatch" = [ "kube-core/jsonpatch" ]; - "jsonpath-rust" = [ "dep:jsonpath-rust" ]; - "kubelet-debug" = [ "ws" "kube-core/kubelet-debug" ]; - "oauth" = [ "client" "tame-oauth" ]; - "oidc" = [ "client" "form_urlencoded" ]; - "openssl" = [ "dep:openssl" ]; - "openssl-tls" = [ "openssl" "hyper-openssl" ]; - "pem" = [ "dep:pem" ]; - "rand" = [ "dep:rand" ]; - "rustls" = [ "dep:rustls" ]; - "rustls-pemfile" = [ "dep:rustls-pemfile" ]; - "rustls-tls" = [ "rustls" "rustls-pemfile" "hyper-rustls" "hyper-http-proxy?/rustls-tls-native-roots" ]; - "serde_yaml" = [ "dep:serde_yaml" ]; - "socks5" = [ "hyper-socks2" ]; - "tame-oauth" = [ "dep:tame-oauth" ]; - "tokio" = [ "dep:tokio" ]; - "tokio-tungstenite" = [ "dep:tokio-tungstenite" ]; - "tokio-util" = [ "dep:tokio-util" ]; - "tower" = [ "dep:tower" ]; - "tower-http" = [ "dep:tower-http" ]; - "tracing" = [ "dep:tracing" ]; - "webpki-roots" = [ "hyper-rustls/webpki-roots" ]; - "ws" = [ "client" "tokio-tungstenite" "rand" "kube-core/ws" "tokio/macros" ]; + name = "k8s-openapi"; + packageId = "k8s-openapi"; + usesDefaultFeatures = false; + features = [ "latest" ]; + } + ]; + features = { + "admission" = [ "kube-core/admission" ]; + "aws-lc-rs" = [ "kube-client?/aws-lc-rs" ]; + "client" = [ "kube-client/client" "config" ]; + "config" = [ "kube-client/config" ]; + "default" = [ "client" "rustls-tls" ]; + "derive" = [ "kube-derive" "kube-core/schema" ]; + "gzip" = [ "kube-client/gzip" "client" ]; + "http-proxy" = [ "kube-client/http-proxy" "client" ]; + "jsonpatch" = [ "kube-core/jsonpatch" ]; + "kube-client" = [ "dep:kube-client" ]; + "kube-derive" = [ "dep:kube-derive" ]; + "kube-runtime" = [ "dep:kube-runtime" ]; + "kubelet-debug" = [ "kube-client/kubelet-debug" "kube-core/kubelet-debug" ]; + "oauth" = [ "kube-client/oauth" "client" ]; + "oidc" = [ "kube-client/oidc" "client" ]; + "openssl-tls" = [ "kube-client/openssl-tls" "client" ]; + "runtime" = [ "kube-runtime" ]; + "rustls-tls" = [ "kube-client/rustls-tls" "client" ]; + "socks5" = [ "kube-client/socks5" "client" ]; + "unstable-client" = [ "kube-client/unstable-client" "client" ]; + "unstable-runtime" = [ "kube-runtime/unstable-runtime" "runtime" ]; + "webpki-roots" = [ "kube-client/webpki-roots" "client" ]; + "ws" = [ "kube-client/ws" "kube-core/ws" ]; }; - resolvedDefaultFeatures = [ "__non_core" "base64" "bytes" "chrono" "client" "config" "either" "futures" "home" "http-body" "http-body-util" "hyper" "hyper-rustls" "hyper-timeout" "hyper-util" "jsonpatch" "jsonpath-rust" "pem" "rustls" "rustls-pemfile" "rustls-tls" "serde_yaml" "tokio" "tokio-util" "tower" "tower-http" "tracing" ]; + resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; }; - "kube-client 0.98.0" = rec { + "kube-client" = rec { crateName = "kube-client"; version = "0.98.0"; edition = "2021"; @@ -4631,17 +4071,17 @@ rec { } { name = "jsonpath-rust"; - packageId = "jsonpath-rust 0.7.5"; + packageId = "jsonpath-rust"; optional = true; } { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; } { name = "kube-core"; - packageId = "kube-core 0.98.0"; + packageId = "kube-core"; } { name = "pem"; @@ -4726,7 +4166,7 @@ rec { } { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -4787,84 +4227,7 @@ rec { }; resolvedDefaultFeatures = [ "__non_core" "base64" "bytes" "chrono" "client" "config" "either" "futures" "home" "http-body" "http-body-util" "hyper" "hyper-rustls" "hyper-timeout" "hyper-util" "jsonpatch" "jsonpath-rust" "pem" "rustls" "rustls-pemfile" "rustls-tls" "serde_yaml" "tokio" "tokio-util" "tower" "tower-http" "tracing" ]; }; - "kube-core 0.96.0" = rec { - crateName = "kube-core"; - version = "0.96.0"; - edition = "2021"; - sha256 = "0xrxzqk7nbbymf7ycm02wshs6ynf3dlrnm2wvix1skdk1g9lc8zl"; - libName = "kube_core"; - authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " - ]; - dependencies = [ - { - name = "chrono"; - packageId = "chrono"; - usesDefaultFeatures = false; - features = [ "now" ]; - } - { - name = "form_urlencoded"; - packageId = "form_urlencoded"; - } - { - name = "http"; - packageId = "http"; - } - { - name = "json-patch"; - packageId = "json-patch 2.0.0"; - optional = true; - } - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - } - { - name = "schemars"; - packageId = "schemars"; - optional = true; - } - { - name = "serde"; - packageId = "serde"; - features = [ "derive" ]; - } - { - name = "serde-value"; - packageId = "serde-value"; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "thiserror"; - packageId = "thiserror 1.0.69"; - } - ]; - devDependencies = [ - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - features = [ "latest" ]; - } - ]; - features = { - "admission" = [ "json-patch" ]; - "json-patch" = [ "dep:json-patch" ]; - "jsonpatch" = [ "json-patch" ]; - "kubelet-debug" = [ "ws" ]; - "schema" = [ "schemars" ]; - "schemars" = [ "dep:schemars" ]; - }; - resolvedDefaultFeatures = [ "json-patch" "jsonpatch" "schema" "schemars" ]; - }; - "kube-core 0.98.0" = rec { + "kube-core" = rec { crateName = "kube-core"; version = "0.98.0"; edition = "2021"; @@ -4892,12 +4255,12 @@ rec { } { name = "json-patch"; - packageId = "json-patch 3.0.1"; + packageId = "json-patch"; optional = true; } { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; } { @@ -4926,7 +4289,7 @@ rec { devDependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -4941,44 +4304,7 @@ rec { }; resolvedDefaultFeatures = [ "json-patch" "jsonpatch" "schema" "schemars" ]; }; - "kube-derive 0.96.0" = rec { - crateName = "kube-derive"; - version = "0.96.0"; - edition = "2021"; - sha256 = "1bc23sismxyyncsry902b2i2v0aifpxvgs3fdh9q412yrh24wdpr"; - procMacro = true; - libName = "kube_derive"; - authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " - ]; - dependencies = [ - { - name = "darling"; - packageId = "darling"; - } - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "syn"; - packageId = "syn 2.0.96"; - features = [ "extra-traits" ]; - } - ]; - - }; - "kube-derive 0.98.0" = rec { + "kube-derive" = rec { crateName = "kube-derive"; version = "0.98.0"; edition = "2021"; @@ -5015,130 +4341,7 @@ rec { ]; }; - "kube-runtime 0.96.0" = rec { - crateName = "kube-runtime"; - version = "0.96.0"; - edition = "2021"; - sha256 = "0i5xr5i9xf44fwih1pvypr35sq30pcw979m9sbqnb3m9zzvg3yyk"; - libName = "kube_runtime"; - authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " - ]; - dependencies = [ - { - name = "ahash"; - packageId = "ahash"; - } - { - name = "async-broadcast"; - packageId = "async-broadcast"; - } - { - name = "async-stream"; - packageId = "async-stream"; - } - { - name = "async-trait"; - packageId = "async-trait"; - } - { - name = "backoff"; - packageId = "backoff"; - } - { - name = "educe"; - packageId = "educe"; - usesDefaultFeatures = false; - features = [ "Clone" "Debug" "Hash" "PartialEq" ]; - } - { - name = "futures"; - packageId = "futures 0.3.31"; - usesDefaultFeatures = false; - features = [ "async-await" ]; - } - { - name = "hashbrown"; - packageId = "hashbrown 0.14.5"; - } - { - name = "json-patch"; - packageId = "json-patch 2.0.0"; - } - { - name = "jsonptr"; - packageId = "jsonptr 0.4.7"; - } - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - } - { - name = "kube-client"; - packageId = "kube-client 0.96.0"; - usesDefaultFeatures = false; - features = [ "jsonpatch" "client" ]; - } - { - name = "parking_lot"; - packageId = "parking_lot"; - } - { - name = "pin-project"; - packageId = "pin-project"; - } - { - name = "serde"; - packageId = "serde"; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "thiserror"; - packageId = "thiserror 1.0.69"; - } - { - name = "tokio"; - packageId = "tokio"; - features = [ "time" ]; - } - { - name = "tokio-util"; - packageId = "tokio-util"; - features = [ "time" ]; - } - { - name = "tracing"; - packageId = "tracing"; - } - ]; - devDependencies = [ - { - name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; - usesDefaultFeatures = false; - features = [ "latest" ]; - } - { - name = "serde_json"; - packageId = "serde_json"; - } - { - name = "tokio"; - packageId = "tokio"; - features = [ "full" "test-util" ]; - } - ]; - features = { - "unstable-runtime" = [ "unstable-runtime-subscribe" "unstable-runtime-stream-control" "unstable-runtime-reconcile-on" ]; - }; - }; - "kube-runtime 0.98.0" = rec { + "kube-runtime" = rec { crateName = "kube-runtime"; version = "0.98.0"; edition = "2021"; @@ -5184,7 +4387,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown 0.15.2"; + packageId = "hashbrown"; } { name = "hostname"; @@ -5192,20 +4395,20 @@ rec { } { name = "json-patch"; - packageId = "json-patch 3.0.1"; + packageId = "json-patch"; } { name = "jsonptr"; - packageId = "jsonptr 0.6.3"; + packageId = "jsonptr"; } { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; } { name = "kube-client"; - packageId = "kube-client 0.98.0"; + packageId = "kube-client"; usesDefaultFeatures = false; features = [ "jsonpatch" "client" ]; } @@ -5247,7 +4450,7 @@ rec { devDependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -6607,7 +5810,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags 2.8.0"; + packageId = "bitflags"; } ]; features = { @@ -7262,7 +6465,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags 2.8.0"; + packageId = "bitflags"; } { name = "core-foundation"; @@ -7309,7 +6512,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags 2.8.0"; + packageId = "bitflags"; } { name = "core-foundation"; @@ -7999,17 +7202,17 @@ rec { } { name = "json-patch"; - packageId = "json-patch 3.0.1"; + packageId = "json-patch"; } { name = "k8s-openapi"; - packageId = "k8s-openapi 0.24.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; features = [ "schemars" "v1_32" ]; } { name = "kube"; - packageId = "kube 0.98.0"; + packageId = "kube"; usesDefaultFeatures = false; features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; } @@ -8154,7 +7357,7 @@ rec { dependencies = [ { name = "kube"; - packageId = "kube 0.98.0"; + packageId = "kube"; usesDefaultFeatures = false; features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; } @@ -8180,13 +7383,13 @@ rec { }; "stackable-versioned" = rec { crateName = "stackable-versioned"; - version = "0.5.0"; + version = "0.5.1"; edition = "2021"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "048c7d8befddc2f2c6414444006871c95412d67c"; - sha256 = "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6"; + rev = "c07fd5d7237b0774b6bf4c8f3878df3b59b4ec07"; + sha256 = "1l574x35z5ylidbc3qm0crp9qravhyry8i07ww3b1kpcr4w7dd53"; }; libName = "stackable_versioned"; authors = [ @@ -8206,13 +7409,13 @@ rec { }; "stackable-versioned-macros" = rec { crateName = "stackable-versioned-macros"; - version = "0.5.0"; + version = "0.5.1"; edition = "2021"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "048c7d8befddc2f2c6414444006871c95412d67c"; - sha256 = "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6"; + rev = "c07fd5d7237b0774b6bf4c8f3878df3b59b4ec07"; + sha256 = "1l574x35z5ylidbc3qm0crp9qravhyry8i07ww3b1kpcr4w7dd53"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -8234,10 +7437,10 @@ rec { } { name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; + packageId = "k8s-openapi"; optional = true; usesDefaultFeatures = false; - features = [ "schemars" "v1_31" ]; + features = [ "schemars" "v1_32" ]; } { name = "k8s-version"; @@ -8246,7 +7449,7 @@ rec { } { name = "kube"; - packageId = "kube 0.96.0"; + packageId = "kube"; optional = true; usesDefaultFeatures = false; features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; @@ -8267,9 +7470,9 @@ rec { devDependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi 0.23.0"; + packageId = "k8s-openapi"; usesDefaultFeatures = false; - features = [ "schemars" "v1_31" ]; + features = [ "schemars" "v1_32" ]; } ]; features = { @@ -9349,7 +8552,7 @@ rec { } { name = "bitflags"; - packageId = "bitflags 2.8.0"; + packageId = "bitflags"; } { name = "bytes"; diff --git a/Cargo.toml b/Cargo.toml index 1968c5c2..c0cb19d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "1.0" serde_yaml = "0.9" snafu = "0.8" stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" } -stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" } +stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.1" } product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } diff --git a/crate-hashes.json b/crate-hashes.json index c7d32c3a..a8f33506 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -2,8 +2,8 @@ "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#stackable-operator-derive@0.3.1": "0rh476rmn5850yj85hq8znwmlfhd7l5bkxz0n5i9m4cddxhi2cl5", "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#stackable-operator@0.85.0": "0rh476rmn5850yj85hq8znwmlfhd7l5bkxz0n5i9m4cddxhi2cl5", "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.85.0#stackable-shared@0.0.1": "0rh476rmn5850yj85hq8znwmlfhd7l5bkxz0n5i9m4cddxhi2cl5", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#k8s-version@0.1.2": "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#stackable-versioned-macros@0.5.0": "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.0#stackable-versioned@0.5.0": "1x2pfibrsysmkkmajyj30qkwsjf3rzmc3dxsd09jb9r4x7va6mr6", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.1#k8s-version@0.1.2": "1l574x35z5ylidbc3qm0crp9qravhyry8i07ww3b1kpcr4w7dd53", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.1#stackable-versioned-macros@0.5.1": "1l574x35z5ylidbc3qm0crp9qravhyry8i07ww3b1kpcr4w7dd53", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-versioned-0.5.1#stackable-versioned@0.5.1": "1l574x35z5ylidbc3qm0crp9qravhyry8i07ww3b1kpcr4w7dd53", "git+https://github.com/stackabletech/product-config.git?tag=0.7.0#product-config@0.7.0": "0gjsm80g6r75pm3824dcyiz4ysq1ka4c1if6k1mjm9cnd5ym0gny" } \ No newline at end of file diff --git a/deploy/helm/zookeeper-operator/crds/crds.yaml b/deploy/helm/zookeeper-operator/crds/crds.yaml index d8c9eb00..82389036 100644 --- a/deploy/helm/zookeeper-operator/crds/crds.yaml +++ b/deploy/helm/zookeeper-operator/crds/crds.yaml @@ -789,6 +789,7 @@ spec: kind: ZookeeperZnode plural: zookeeperznodes shortNames: + - zno - znode singular: zookeeperznode scope: Namespaced diff --git a/rust/operator-binary/src/crd/affinity.rs b/rust/operator-binary/src/crd/affinity.rs index d33f815d..97d354ab 100644 --- a/rust/operator-binary/src/crd/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -37,7 +37,7 @@ mod tests { role_utils::RoleGroupRef, }; - use crate::crd::{affinity::ZookeeperRole, v1alpha1::ZookeeperCluster}; + use crate::crd::{affinity::ZookeeperRole, v1alpha1}; #[test] fn test_affinity_defaults() { @@ -60,7 +60,8 @@ mod tests { default: replicas: 3 "#; - let zk: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); + let zk: v1alpha1::ZookeeperCluster = + serde_yaml::from_str(input).expect("illegal test input"); let rolegroup_ref = RoleGroupRef { cluster: ObjectRef::from_obj(&zk), diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 97213893..10787617 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -36,10 +36,7 @@ use stackable_operator::{ use stackable_versioned::versioned; use strum::{Display, EnumIter, EnumString, IntoEnumIterator}; -use crate::crd::{ - affinity::get_affinity, authentication::v1alpha1::ZookeeperAuthentication, - tls::v1alpha1::ZookeeperTls, -}; +use crate::crd::affinity::get_affinity; pub mod affinity; pub mod authentication; @@ -161,7 +158,7 @@ pub mod versioned { /// Authentication settings for ZooKeeper like mTLS authentication. /// Read more in the [authentication usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/authentication). #[serde(default)] - pub authentication: Vec, + pub authentication: Vec, /// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery). /// It must contain the key `ADDRESS` with the address of the Vector aggregator. @@ -176,7 +173,7 @@ pub mod versioned { default = "tls::default_zookeeper_tls", skip_serializing_if = "Option::is_none" )] - pub tls: Option, + pub tls: Option, /// This field controls which type of Service the Operator creates for this ZookeeperCluster: /// @@ -306,9 +303,7 @@ pub mod versioned { group = "zookeeper.stackable.tech", kind = "ZookeeperZnode", plural = "zookeeperznodes", - // TODO: stackable-versioned currently only supports a single shortname. - // Leaving this one commented for now. - // shortname = "zno", + shortname = "zno", shortname = "znode", status = "ZookeeperZnodeStatus", namespaced, diff --git a/rust/operator-binary/src/crd/security.rs b/rust/operator-binary/src/crd/security.rs index ee210f9f..9524b7a9 100644 --- a/rust/operator-binary/src/crd/security.rs +++ b/rust/operator-binary/src/crd/security.rs @@ -25,9 +25,7 @@ use stackable_operator::{ time::Duration, }; -use crate::crd::{ - authentication, authentication::ResolvedAuthenticationClasses, tls, v1alpha1::ZookeeperCluster, -}; +use crate::crd::{authentication, authentication::ResolvedAuthenticationClasses, tls, v1alpha1}; type Result = std::result::Result; @@ -95,7 +93,7 @@ impl ZookeeperSecurity { /// all provided `AuthenticationClass` references. pub async fn new_from_zookeeper_cluster( client: &Client, - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, ) -> Result { Ok(ZookeeperSecurity { resolved_authentication_classes: authentication::resolve_authentication_classes( diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index 329c6320..f040c73d 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -10,7 +10,7 @@ use stackable_operator::{ }; use crate::{ - crd::{security::ZookeeperSecurity, v1alpha1::ZookeeperCluster, ZookeeperRole}, + crd::{security::ZookeeperSecurity, v1alpha1, ZookeeperRole}, utils::build_recommended_labels, }; @@ -21,7 +21,7 @@ pub enum Error { #[snafu(display("object {} is missing metadata to build owner reference", zk))] ObjectMissingMetadataForOwnerRef { source: stackable_operator::builder::meta::Error, - zk: ObjectRef, + zk: ObjectRef, }, #[snafu(display("chroot path {} was relative (must be absolute)", chroot))] @@ -65,7 +65,7 @@ pub enum Error { /// Builds discovery [`ConfigMap`]s for connecting to a [`crate::crd::v1alpha1::ZookeeperCluster`] for all expected scenarios #[allow(clippy::too_many_arguments)] pub async fn build_discovery_configmaps( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, owner: &impl Resource, client: &stackable_operator::client::Client, controller_name: &str, @@ -112,7 +112,7 @@ pub async fn build_discovery_configmaps( /// `hosts` will usually come from either [`pod_hosts`] or [`nodeport_hosts`]. #[allow(clippy::too_many_arguments)] fn build_discovery_configmap( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, owner: &impl Resource, zookeeper_security: &ZookeeperSecurity, name: &str, @@ -170,7 +170,7 @@ fn build_discovery_configmap( /// Lists all Pods FQDNs expected to host the [`crate::crd::v1alpha1::ZookeeperCluster`] fn pod_hosts<'a>( - zk: &'a ZookeeperCluster, + zk: &'a v1alpha1::ZookeeperCluster, zookeeper_security: &'a ZookeeperSecurity, cluster_info: &'a KubernetesClusterInfo, ) -> Result + 'a> { diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 6c0f99b5..24c6c188 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,10 +1,7 @@ use std::sync::Arc; use clap::{crate_description, crate_version, Parser}; -use crd::{ - v1alpha1::{ZookeeperCluster, ZookeeperZnode}, - APP_NAME, OPERATOR_NAME, -}; +use crd::{v1alpha1, APP_NAME, OPERATOR_NAME}; use futures::{pin_mut, StreamExt}; use stackable_operator::{ cli::{Command, ProductOperatorRun}, @@ -54,8 +51,8 @@ async fn main() -> anyhow::Result<()> { let opts = Opts::parse(); match opts.cmd { Command::Crd => { - ZookeeperCluster::print_yaml_schema(built_info::CARGO_PKG_VERSION)?; - ZookeeperZnode::print_yaml_schema(built_info::CARGO_PKG_VERSION)?; + v1alpha1::ZookeeperCluster::print_yaml_schema(built_info::CARGO_PKG_VERSION)?; + v1alpha1::ZookeeperZnode::print_yaml_schema(built_info::CARGO_PKG_VERSION)?; } Command::Run(ProductOperatorRun { product_config, @@ -87,7 +84,7 @@ async fn main() -> anyhow::Result<()> { .await?; let zk_controller = Controller::new( - watch_namespace.get_api::>(&client), + watch_namespace.get_api::>(&client), watcher::Config::default(), ); @@ -158,7 +155,7 @@ async fn main() -> anyhow::Result<()> { ); let znode_controller = Controller::new( - watch_namespace.get_api::>(&client), + watch_namespace.get_api::>(&client), watcher::Config::default(), ); let znode_event_recorder = Arc::new(Recorder::new( @@ -176,7 +173,8 @@ async fn main() -> anyhow::Result<()> { watcher::Config::default(), ) .watches( - watch_namespace.get_api::>(&client), + watch_namespace + .get_api::>(&client), watcher::Config::default(), move |zk| { znode_store diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index f6bcc2f0..77a7702b 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -1,7 +1,7 @@ use snafu::{ResultExt, Snafu}; use stackable_operator::builder::pod::PodBuilder; -use crate::crd::v1alpha1::ZookeeperConfig; +use crate::crd::v1alpha1; #[derive(Debug, Snafu)] pub enum Error { @@ -12,7 +12,7 @@ pub enum Error { } pub fn add_graceful_shutdown_config( - merged_config: &ZookeeperConfig, + merged_config: &v1alpha1::ZookeeperConfig, pod_builder: &mut PodBuilder, ) -> Result<(), Error> { // This must be always set by the merge mechanism, as we provide a default value, diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index e09d6bca..908d80c0 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -5,7 +5,7 @@ use stackable_operator::{ }; use crate::{ - crd::{v1alpha1::ZookeeperCluster, ZookeeperRole, APP_NAME, OPERATOR_NAME}, + crd::{v1alpha1, ZookeeperRole, APP_NAME, OPERATOR_NAME}, zk_controller::ZK_CONTROLLER_NAME, }; @@ -25,7 +25,7 @@ pub enum Error { pub async fn add_pdbs( pdb: &PdbConfig, - zookeeper: &ZookeeperCluster, + zookeeper: &v1alpha1::ZookeeperCluster, role: &ZookeeperRole, client: &Client, cluster_resources: &mut ClusterResources, diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index 2233e115..65d18965 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -13,9 +13,8 @@ use stackable_operator::{ }; use crate::crd::{ - v1alpha1::{Container, ZookeeperCluster}, - LoggingFramework, ZookeeperRole, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, - STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, + v1alpha1, LoggingFramework, ZookeeperRole, LOG4J_CONFIG_FILE, LOGBACK_CONFIG_FILE, + MAX_ZK_LOG_FILES_SIZE, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, }; #[derive(Snafu, Debug)] @@ -50,7 +49,7 @@ const CONSOLE_CONVERSION_PATTERN: &str = "%d{ISO8601} [myid:%X{myid}] - %-5p [%t /// Return the address of the Vector aggregator if the corresponding ConfigMap name is given in the /// cluster spec pub async fn resolve_vector_aggregator_address( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, client: &Client, ) -> Result> { let vector_aggregator_address = if let Some(vector_aggregator_config_map_name) = &zk @@ -86,9 +85,9 @@ pub async fn resolve_vector_aggregator_address( /// Extend the role group ConfigMap with logging and Vector configurations pub fn extend_role_group_config_map( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, role: ZookeeperRole, - rolegroup: &RoleGroupRef, + rolegroup: &RoleGroupRef, vector_aggregator_address: Option<&str>, cm_builder: &mut ConfigMapBuilder, ) -> Result<()> { @@ -98,7 +97,7 @@ pub fn extend_role_group_config_map( if let Some(ContainerLogConfig { choice: Some(ContainerLogConfigChoice::Automatic(log_config)), - }) = logging.containers.get(&Container::Zookeeper) + }) = logging.containers.get(&v1alpha1::Container::Zookeeper) { match zk.logging_framework() { LoggingFramework::LOG4J => { @@ -137,7 +136,7 @@ pub fn extend_role_group_config_map( let vector_log_config = if let Some(ContainerLogConfig { choice: Some(ContainerLogConfigChoice::Automatic(log_config)), - }) = logging.containers.get(&Container::Vector) + }) = logging.containers.get(&v1alpha1::Container::Vector) { Some(log_config) } else { diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 554f126c..0705c019 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -70,8 +70,7 @@ use crate::{ command::create_init_container_command_args, crd::{ security::{self, ZookeeperSecurity}, - v1alpha1::{Container, ZookeeperCluster, ZookeeperClusterStatus, ZookeeperConfig}, - ZookeeperRole, DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, + v1alpha1, ZookeeperRole, DOCKER_IMAGE_BASE_NAME, JVM_SECURITY_PROPERTIES_FILE, MAX_PREPARE_LOG_FILE_SIZE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, @@ -126,7 +125,7 @@ pub enum Error { #[snafu(display("failed to calculate service name for role {}", rolegroup))] RoleGroupServiceNameNotFound { - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("failed to apply global Service"))] @@ -137,25 +136,25 @@ pub enum Error { #[snafu(display("failed to apply Service for {}", rolegroup))] ApplyRoleGroupService { source: stackable_operator::cluster_resources::Error, - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("failed to build ConfigMap for {}", rolegroup))] BuildRoleGroupConfig { source: stackable_operator::builder::configmap::Error, - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("failed to apply ConfigMap for {}", rolegroup))] ApplyRoleGroupConfig { source: stackable_operator::cluster_resources::Error, - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("failed to apply StatefulSet for {}", rolegroup))] ApplyRoleGroupStatefulSet { source: stackable_operator::cluster_resources::Error, - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("failed to generate product config"))] @@ -171,7 +170,7 @@ pub enum Error { #[snafu(display("failed to serialize [{ZOOKEEPER_PROPERTIES_FILE}] for {}", rolegroup))] SerializeZooCfg { source: PropertiesWriterError, - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("object is missing metadata to build owner reference"))] @@ -319,7 +318,7 @@ impl ReconcilerError for Error { } pub async fn reconcile_zk( - zk: Arc>, + zk: Arc>, ctx: Arc, ) -> Result { tracing::info!("Starting reconcile"); @@ -502,7 +501,7 @@ pub async fn reconcile_zk( let cluster_operation_cond_builder = ClusterOperationsConditionBuilder::new(&zk.spec.cluster_operation); - let status = ZookeeperClusterStatus { + let status = v1alpha1::ZookeeperClusterStatus { // Serialize as a string to discourage users from trying to parse the value, // and to keep things flexible if we end up changing the hasher at some point. discovery_hash: Some(discovery_hash.finish().to_string()), @@ -527,7 +526,7 @@ pub async fn reconcile_zk( /// Note that you should generally *not* hard-code clients to use these services; instead, create a [`v1alpha1::ZookeeperZnode`](`crate::crd::v1alpha1::ZookeeperZnode`) /// and use the connection string that it gives you. pub fn build_server_role_service( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, resolved_product_image: &ResolvedProductImage, zookeeper_security: &ZookeeperSecurity, ) -> Result { @@ -575,8 +574,8 @@ pub fn build_server_role_service( /// The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator fn build_server_rolegroup_config_map( - zk: &ZookeeperCluster, - rolegroup: &RoleGroupRef, + zk: &v1alpha1::ZookeeperCluster, + rolegroup: &RoleGroupRef, server_config: &HashMap>, resolved_product_image: &ResolvedProductImage, vector_aggregator_address: Option<&str>, @@ -684,8 +683,8 @@ fn build_server_rolegroup_config_map( /// /// This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing. fn build_server_rolegroup_service( - zk: &ZookeeperCluster, - rolegroup: &RoleGroupRef, + zk: &v1alpha1::ZookeeperCluster, + rolegroup: &RoleGroupRef, resolved_product_image: &ResolvedProductImage, zookeeper_security: &ZookeeperSecurity, ) -> Result { @@ -747,13 +746,13 @@ fn build_server_rolegroup_service( /// The [`Pod`](`stackable_operator::k8s_openapi::api::core::v1::Pod`)s are accessible through the corresponding [`Service`] (from [`build_server_rolegroup_service`]). #[allow(clippy::too_many_arguments)] fn build_server_rolegroup_statefulset( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, zk_role: &ZookeeperRole, - rolegroup_ref: &RoleGroupRef, + rolegroup_ref: &RoleGroupRef, server_config: &HashMap>, zookeeper_security: &ZookeeperSecurity, resolved_product_image: &ResolvedProductImage, - merged_config: &ZookeeperConfig, + merged_config: &v1alpha1::ZookeeperConfig, service_account: &ServiceAccount, ) -> Result { let role = zk.role(zk_role).context(InternalOperatorFailureSnafu)?; @@ -785,7 +784,7 @@ fn build_server_rolegroup_statefulset( .context(InvalidJavaHeapConfigSnafu)?; if let Some(heap_limits) = heap_limits { env_vars.push(EnvVar { - name: ZookeeperConfig::ZK_SERVER_HEAP.to_string(), + name: v1alpha1::ZookeeperConfig::ZK_SERVER_HEAP.to_string(), value: Some(heap_limits.to_string()), ..EnvVar::default() }); @@ -813,7 +812,7 @@ fn build_server_rolegroup_statefulset( if let Some(ContainerLogConfig { choice: Some(ContainerLogConfigChoice::Automatic(log_config)), - }) = logging.containers.get(&Container::Prepare) + }) = logging.containers.get(&v1alpha1::Container::Prepare) { args.push(product_logging::framework::capture_shell_output( STACKABLE_LOG_DIR, @@ -981,7 +980,7 @@ fn build_server_rolegroup_statefulset( Some(ContainerLogConfigChoice::Custom(CustomContainerLogConfig { custom: ConfigMapLogConfig { config_map }, })), - }) = logging.containers.get(&Container::Zookeeper) + }) = logging.containers.get(&v1alpha1::Container::Zookeeper) { pod_builder .add_volume(Volume { @@ -1012,7 +1011,7 @@ fn build_server_rolegroup_statefulset( resolved_product_image, "config", "log", - logging.containers.get(&Container::Vector), + logging.containers.get(&v1alpha1::Container::Vector), ResourceRequirementsBuilder::new() .with_cpu_request("250m") .with_cpu_limit("500m") @@ -1073,7 +1072,7 @@ fn build_server_rolegroup_statefulset( } pub fn error_policy( - _obj: Arc>, + _obj: Arc>, error: &Error, _ctx: Arc, ) -> controller::Action { @@ -1161,7 +1160,7 @@ mod tests { } fn build_config_map(zookeeper_yaml: &str) -> ConfigMap { - let mut zookeeper: ZookeeperCluster = + let mut zookeeper: v1alpha1::ZookeeperCluster = serde_yaml::from_str(zookeeper_yaml).expect("illegal test input"); zookeeper.metadata.uid = Some("42".to_owned()); let cluster_info = KubernetesClusterInfo { diff --git a/rust/operator-binary/src/znode_controller.rs b/rust/operator-binary/src/znode_controller.rs index 7356c971..39da9670 100644 --- a/rust/operator-binary/src/znode_controller.rs +++ b/rust/operator-binary/src/znode_controller.rs @@ -24,11 +24,7 @@ use strum::{EnumDiscriminants, IntoStaticStr}; use tracing::{debug, info}; use crate::{ - crd::{ - security::ZookeeperSecurity, - v1alpha1::{ZookeeperCluster, ZookeeperZnode, ZookeeperZnodeStatus}, - DOCKER_IMAGE_BASE_NAME, - }, + crd::{security::ZookeeperSecurity, v1alpha1, DOCKER_IMAGE_BASE_NAME}, discovery::{self, build_discovery_configmaps}, APP_NAME, OPERATOR_NAME, }; @@ -60,37 +56,41 @@ pub enum Error { #[snafu(display("could not find {}", zk))] FindZk { source: stackable_operator::client::Error, - zk: ObjectRef, + zk: ObjectRef, }, ZkDoesNotExist { source: stackable_operator::client::Error, - zk: ObjectRef, + zk: ObjectRef, }, #[snafu(display("could not find server role service name for {}", zk))] - NoZkSvcName { zk: ObjectRef }, + NoZkSvcName { + zk: ObjectRef, + }, #[snafu(display("could not find server role service for {}", zk))] FindZkSvc { source: stackable_operator::client::Error, - zk: ObjectRef, + zk: ObjectRef, }, #[snafu(display("failed to calculate FQDN for {}", zk))] - NoZkFqdn { zk: ObjectRef }, + NoZkFqdn { + zk: ObjectRef, + }, #[snafu(display("failed to ensure that ZNode {} exists in {}", znode_path, zk))] EnsureZnode { source: znode_mgmt::Error, - zk: ObjectRef, + zk: ObjectRef, znode_path: String, }, #[snafu(display("failed to ensure that ZNode {} is missing from {}", znode_path, zk))] EnsureZnodeMissing { source: znode_mgmt::Error, - zk: ObjectRef, + zk: ObjectRef, znode_path: String, }, @@ -176,7 +176,7 @@ impl ReconcilerError for Error { } pub async fn reconcile_znode( - znode: Arc>, + znode: Arc>, ctx: Arc, ) -> Result { tracing::info!("Starting reconcile"); @@ -198,7 +198,7 @@ pub async fn reconcile_znode( let client = &ctx.client; let zk = find_zk_of_znode(client, znode).await; - let mut default_status_updates: Option = None; + let mut default_status_updates: Option = None; // Store the znode path in the status rather than the object itself, to ensure that only K8s administrators can override it let znode_path = match znode.status.as_ref().and_then(|s| s.znode_path.as_deref()) { Some(znode_path) => { @@ -229,7 +229,7 @@ pub async fn reconcile_znode( } finalizer( - &client.get_api::(&ns), + &client.get_api::(&ns), &format!("{OPERATOR_NAME}/znode"), Arc::new(znode.clone()), |ev| async { @@ -255,8 +255,8 @@ pub async fn reconcile_znode( async fn reconcile_apply( client: &stackable_operator::client::Client, - znode: &ZookeeperZnode, - zk: Result, + znode: &v1alpha1::ZookeeperZnode, + zk: Result, znode_path: &str, resolved_product_image: &ResolvedProductImage, ) -> Result { @@ -329,7 +329,7 @@ async fn reconcile_apply( async fn reconcile_cleanup( client: &stackable_operator::client::Client, - zk: Result, + zk: Result, znode_path: &str, ) -> Result { let zk = match zk { @@ -359,7 +359,7 @@ async fn reconcile_cleanup( } fn zk_mgmt_addr( - zk: &ZookeeperCluster, + zk: &v1alpha1::ZookeeperCluster, zookeeper_security: &ZookeeperSecurity, cluster_info: &KubernetesClusterInfo, ) -> Result { @@ -377,14 +377,17 @@ fn zk_mgmt_addr( async fn find_zk_of_znode( client: &stackable_operator::client::Client, - znode: &ZookeeperZnode, -) -> Result { + znode: &v1alpha1::ZookeeperZnode, +) -> Result { let zk_ref = &znode.spec.cluster_ref; if let (Some(zk_name), Some(zk_ns)) = ( zk_ref.name.as_deref(), zk_ref.namespace_relative_from(znode), ) { - match client.get::(zk_name, zk_ns).await { + match client + .get::(zk_name, zk_ns) + .await + { Ok(zk) => Ok(zk), Err(err) => match &err { stackable_operator::client::Error::GetResource { @@ -404,7 +407,7 @@ async fn find_zk_of_znode( } pub fn error_policy( - _obj: Arc>, + _obj: Arc>, _error: &Error, _ctx: Arc, ) -> controller::Action { From b3ae7bd60af1ee91596d5a645a35572be0609043 Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 17 Feb 2025 15:38:06 +0100 Subject: [PATCH 10/11] docs --- rust/operator-binary/src/discovery.rs | 6 +++--- rust/operator-binary/src/zk_controller.rs | 4 ++-- rust/operator-binary/src/znode_controller.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index f040c73d..4f2279a2 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -62,7 +62,7 @@ pub enum Error { }, } -/// Builds discovery [`ConfigMap`]s for connecting to a [`crate::crd::v1alpha1::ZookeeperCluster`] for all expected scenarios +/// Builds discovery [`ConfigMap`]s for connecting to a [`v1alpha1::ZookeeperCluster`] for all expected scenarios #[allow(clippy::too_many_arguments)] pub async fn build_discovery_configmaps( zk: &v1alpha1::ZookeeperCluster, @@ -107,7 +107,7 @@ pub async fn build_discovery_configmaps( Ok(discovery_configmaps) } -/// Build a discovery [`ConfigMap`] containing information about how to connect to a certain [`crate::crd::v1alpha1::ZookeeperCluster`] +/// Build a discovery [`ConfigMap`] containing information about how to connect to a certain [`v1alpha1::ZookeeperCluster`] /// /// `hosts` will usually come from either [`pod_hosts`] or [`nodeport_hosts`]. #[allow(clippy::too_many_arguments)] @@ -168,7 +168,7 @@ fn build_discovery_configmap( .context(BuildConfigMapSnafu) } -/// Lists all Pods FQDNs expected to host the [`crate::crd::v1alpha1::ZookeeperCluster`] +/// Lists all Pods FQDNs expected to host the [`v1alpha1::ZookeeperCluster`] fn pod_hosts<'a>( zk: &'a v1alpha1::ZookeeperCluster, zookeeper_security: &'a ZookeeperSecurity, diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 0705c019..cfc2e14f 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -1,4 +1,4 @@ -//! Ensures that `Pod`s are configured and running for each [`ZookeeperCluster`] +//! Ensures that `Pod`s are configured and running for each [`v1alpha1::ZookeeperCluster`] use std::{ borrow::Cow, collections::{BTreeMap, HashMap}, @@ -523,7 +523,7 @@ pub async fn reconcile_zk( /// The server-role service is the primary endpoint that should be used by clients that do not perform internal load balancing, /// including targets outside of the cluster. /// -/// Note that you should generally *not* hard-code clients to use these services; instead, create a [`v1alpha1::ZookeeperZnode`](`crate::crd::v1alpha1::ZookeeperZnode`) +/// Note that you should generally *not* hard-code clients to use these services; instead, create a [`v1alpha1::ZookeeperZnode`](`v1alpha1::ZookeeperZnode`) /// and use the connection string that it gives you. pub fn build_server_role_service( zk: &v1alpha1::ZookeeperCluster, diff --git a/rust/operator-binary/src/znode_controller.rs b/rust/operator-binary/src/znode_controller.rs index 39da9670..615c030e 100644 --- a/rust/operator-binary/src/znode_controller.rs +++ b/rust/operator-binary/src/znode_controller.rs @@ -1,6 +1,6 @@ -//! Reconciles state for ZooKeeper znodes between Kubernetes [`ZookeeperZnode`] objects and the ZooKeeper cluster +//! Reconciles state for ZooKeeper znodes between Kubernetes [`v1alpha1::ZookeeperZnode`] objects and the ZooKeeper cluster //! -//! See [`ZookeeperZnode`] for more details. +//! See [`v1alpha1::ZookeeperZnode`] for more details. use std::{borrow::Cow, convert::Infallible, sync::Arc}; use const_format::concatcp; From 5f2d69383bf1400f8ee0d017931cce08949aa7ab Mon Sep 17 00:00:00 2001 From: xeniape Date: Mon, 24 Feb 2025 14:00:43 +0100 Subject: [PATCH 11/11] adjust crd printing command --- rust/operator-binary/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 24c6c188..23f9af50 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use clap::{crate_description, crate_version, Parser}; -use crd::{v1alpha1, APP_NAME, OPERATOR_NAME}; +use crd::{v1alpha1, ZookeeperCluster, ZookeeperZnode, APP_NAME, OPERATOR_NAME}; use futures::{pin_mut, StreamExt}; use stackable_operator::{ cli::{Command, ProductOperatorRun}, @@ -19,7 +19,8 @@ use stackable_operator::{ Resource, }, logging::controller::report_controller_reconciled, - CustomResourceExt, + shared::yaml::SerializeOptions, + YamlSchema, }; use crate::{zk_controller::ZK_FULL_CONTROLLER_NAME, znode_controller::ZNODE_FULL_CONTROLLER_NAME}; @@ -51,8 +52,10 @@ async fn main() -> anyhow::Result<()> { let opts = Opts::parse(); match opts.cmd { Command::Crd => { - v1alpha1::ZookeeperCluster::print_yaml_schema(built_info::CARGO_PKG_VERSION)?; - v1alpha1::ZookeeperZnode::print_yaml_schema(built_info::CARGO_PKG_VERSION)?; + ZookeeperCluster::merged_crd(ZookeeperCluster::V1Alpha1)? + .print_yaml_schema(built_info::CARGO_PKG_VERSION, SerializeOptions::default())?; + ZookeeperZnode::merged_crd(ZookeeperZnode::V1Alpha1)? + .print_yaml_schema(built_info::CARGO_PKG_VERSION, SerializeOptions::default())?; } Command::Run(ProductOperatorRun { product_config,