From dbff005b2fc1428f154e7382521871f23bf7027a Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 4 Feb 2025 15:16:35 +0100 Subject: [PATCH 1/7] chore: Remove separate CRD crate --- Cargo.lock | 18 +-------------- Cargo.toml | 2 +- rust/crd/Cargo.toml | 23 ------------------- rust/operator-binary/Cargo.toml | 3 +-- rust/operator-binary/src/config/jvm.rs | 12 +++++----- .../src/crd}/affinity.rs | 2 +- .../lib.rs => operator-binary/src/crd/mod.rs} | 4 ++-- .../src/crd}/security.rs | 0 rust/operator-binary/src/discovery.rs | 2 +- rust/operator-binary/src/hbase_controller.rs | 19 ++++++++------- rust/operator-binary/src/kerberos.rs | 7 +++--- rust/operator-binary/src/main.rs | 4 +++- .../src/operations/graceful_shutdown.rs | 3 ++- rust/operator-binary/src/operations/pdb.rs | 7 ++++-- rust/operator-binary/src/product_logging.rs | 8 ++++--- rust/operator-binary/src/security/opa.rs | 3 ++- rust/operator-binary/src/zookeeper.rs | 3 ++- 17 files changed, 45 insertions(+), 75 deletions(-) delete mode 100644 rust/crd/Cargo.toml rename rust/{crd/src => operator-binary/src/crd}/affinity.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 (100%) diff --git a/Cargo.lock b/Cargo.lock index 1ec3ecfa..85e751ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2329,22 +2329,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "stackable-hbase-crd" -version = "0.0.0-dev" -dependencies = [ - "indoc", - "product-config", - "rstest", - "serde", - "serde_json", - "serde_yaml", - "snafu 0.8.5", - "stackable-operator", - "strum", - "tracing", -] - [[package]] name = "stackable-hbase-operator" version = "0.0.0-dev" @@ -2359,9 +2343,9 @@ dependencies = [ "product-config", "rstest", "serde", + "serde_json", "serde_yaml", "snafu 0.8.5", - "stackable-hbase-crd", "stackable-operator", "strum", "tokio", diff --git a/Cargo.toml b/Cargo.toml index c90d093e..2a22c294 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 e59e4464..00000000 --- a/rust/crd/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "stackable-hbase-crd" -description = "Contains the Apache HBase CRD structs and utilities" -version.workspace = true -authors.workspace = true -license.workspace = true -edition.workspace = true -repository.workspace = true -publish = false - -[dependencies] -product-config.workspace = true -serde.workspace = true -serde_json.workspace = true -snafu.workspace = true -stackable-operator.workspace = true -strum.workspace = true -tracing.workspace = true - -[dev-dependencies] -rstest.workspace = true -serde_yaml.workspace = true -indoc.workspace = true diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index b98a172f..98f44c83 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -9,8 +9,6 @@ repository.workspace = true publish = false [dependencies] -stackable-hbase-crd = { path = "../crd" } - anyhow.workspace = true clap.workspace = true const_format.workspace = true @@ -19,6 +17,7 @@ futures.workspace = true indoc.workspace = true product-config.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/config/jvm.rs b/rust/operator-binary/src/config/jvm.rs index 8a40368e..c83be205 100644 --- a/rust/operator-binary/src/config/jvm.rs +++ b/rust/operator-binary/src/config/jvm.rs @@ -1,13 +1,14 @@ use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_hbase_crd::{ - HbaseConfig, HbaseConfigFragment, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE, - METRICS_PORT, -}; use stackable_operator::{ memory::{BinaryMultiple, MemoryQuantity}, role_utils::{self, GenericRoleConfig, JavaCommonConfig, JvmArgumentOverrides, Role}, }; +use crate::crd::{ + HbaseConfig, HbaseConfigFragment, HbaseRole, CONFIG_DIR_NAME, JVM_SECURITY_PROPERTIES_FILE, + METRICS_PORT, +}; + const JAVA_HEAP_FACTOR: f32 = 0.8; #[derive(Snafu, Debug)] @@ -128,9 +129,8 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool { #[cfg(test)] mod tests { - use stackable_hbase_crd::{HbaseCluster, HbaseRole}; - use super::*; + use crate::crd::{HbaseCluster, HbaseRole}; #[test] fn test_construct_jvm_arguments_defaults() { diff --git a/rust/crd/src/affinity.rs b/rust/operator-binary/src/crd/affinity.rs similarity index 99% rename from rust/crd/src/affinity.rs rename to rust/operator-binary/src/crd/affinity.rs index aa2f8b59..269efdfd 100644 --- a/rust/crd/src/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -5,7 +5,7 @@ use stackable_operator::{ k8s_openapi::api::core::v1::{PodAffinity, PodAntiAffinity}, }; -use crate::{HbaseRole, APP_NAME}; +use crate::crd::{HbaseRole, APP_NAME}; pub fn get_affinity( cluster_name: &str, 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 7c90532f..19c2636b 100644 --- a/rust/crd/src/lib.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -28,7 +28,7 @@ use stackable_operator::{ }; use strum::{Display, EnumIter, EnumString}; -use crate::{affinity::get_affinity, security::AuthorizationConfig}; +use crate::crd::{affinity::get_affinity, security::AuthorizationConfig}; pub mod affinity; pub mod security; @@ -708,7 +708,7 @@ mod tests { transform_all_roles_to_config, validate_all_roles_and_groups_config, }; - use crate::{merged_env, HbaseCluster, HbaseRole}; + use crate::crd::{merged_env, HbaseCluster, HbaseRole}; #[test] pub fn test_env_overrides() { diff --git a/rust/crd/src/security.rs b/rust/operator-binary/src/crd/security.rs similarity index 100% rename from rust/crd/src/security.rs rename to rust/operator-binary/src/crd/security.rs diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index f5c9e8a4..e8241614 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -2,7 +2,6 @@ use std::collections::BTreeMap; use product_config::writer::to_hadoop_xml; use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::{HbaseCluster, HbaseRole, HBASE_SITE_XML}; use stackable_operator::{ builder::{configmap::ConfigMapBuilder, meta::ObjectMetaBuilder}, commons::product_image_selection::ResolvedProductImage, @@ -12,6 +11,7 @@ use stackable_operator::{ }; use crate::{ + crd::{HbaseCluster, HbaseRole, HBASE_SITE_XML}, hbase_controller::build_recommended_labels, kerberos::{self, kerberos_discovery_config_properties}, zookeeper::ZookeeperConnectionInformation, diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index f5d46041..3545c961 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -14,12 +14,6 @@ use product_config::{ ProductConfigManager, }; use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_hbase_crd::{ - merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment, - HbaseRole, APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, - HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, - SSL_SERVER_XML, -}; use stackable_operator::{ builder::{ self, @@ -77,6 +71,12 @@ use crate::{ construct_global_jvm_args, construct_hbase_heapsize_env, construct_role_specific_non_heap_jvm_args, }, + crd::{ + merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment, + HbaseRole, APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, + HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, + SSL_SERVER_XML, + }, discovery::build_discovery_configmap, kerberos::{ self, add_kerberos_pod_config, kerberos_config_properties, @@ -88,8 +88,7 @@ use crate::{ extend_role_group_config_map, log4j_properties_file_name, resolve_vector_aggregator_address, STACKABLE_LOG_DIR, }, - security, - security::opa::HbaseOpaConfig, + security::{self, opa::HbaseOpaConfig}, zookeeper::{self, ZookeeperConnectionInformation}, OPERATOR_NAME, }; @@ -232,10 +231,10 @@ pub enum Error { }, #[snafu(display("failed to retrieve Hbase role group: {source}"))] - UnidentifiedHbaseRoleGroup { source: stackable_hbase_crd::Error }, + UnidentifiedHbaseRoleGroup { source: crate::crd::Error }, #[snafu(display("failed to resolve and merge config for role and role group"))] - FailedToResolveConfig { source: stackable_hbase_crd::Error }, + FailedToResolveConfig { source: crate::crd::Error }, #[snafu(display("failed to resolve the Vector aggregator address"))] ResolveVectorAggregatorAddress { diff --git a/rust/operator-binary/src/kerberos.rs b/rust/operator-binary/src/kerberos.rs index e19aa33a..d488e7f3 100644 --- a/rust/operator-binary/src/kerberos.rs +++ b/rust/operator-binary/src/kerberos.rs @@ -2,9 +2,6 @@ use std::collections::BTreeMap; use indoc::formatdoc; use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_hbase_crd::{ - HbaseCluster, HbaseRole, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME, -}; use stackable_operator::{ builder::{ self, @@ -19,6 +16,10 @@ use stackable_operator::{ utils::cluster_info::KubernetesClusterInfo, }; +use crate::crd::{ + HbaseCluster, HbaseRole, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME, +}; + #[derive(Snafu, Debug)] pub enum Error { #[snafu(display("object {hbase} is missing namespace"))] diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index d5446e88..9abdaec0 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -3,7 +3,6 @@ use std::sync::Arc; use clap::Parser; use futures::StreamExt; use hbase_controller::FULL_HBASE_CONTROLLER_NAME; -use stackable_hbase_crd::{HbaseCluster, APP_NAME}; use stackable_operator::{ cli::{Command, ProductOperatorRun}, k8s_openapi::api::{apps::v1::StatefulSet, core::v1::Service}, @@ -18,7 +17,10 @@ use stackable_operator::{ CustomResourceExt, }; +use crate::crd::{HbaseCluster, APP_NAME}; + mod config; +mod crd; mod discovery; mod hbase_controller; mod kerberos; diff --git a/rust/operator-binary/src/operations/graceful_shutdown.rs b/rust/operator-binary/src/operations/graceful_shutdown.rs index 509c3260..c5e2f83b 100644 --- a/rust/operator-binary/src/operations/graceful_shutdown.rs +++ b/rust/operator-binary/src/operations/graceful_shutdown.rs @@ -1,7 +1,8 @@ use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::HbaseConfig; use stackable_operator::builder::pod::PodBuilder; +use crate::crd::HbaseConfig; + #[derive(Debug, Snafu)] pub enum Error { #[snafu(display("Failed to set terminationGracePeriod"))] diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 5ff0c49d..3d3505db 100644 --- a/rust/operator-binary/src/operations/pdb.rs +++ b/rust/operator-binary/src/operations/pdb.rs @@ -1,11 +1,14 @@ use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::{HbaseCluster, HbaseRole, APP_NAME}; use stackable_operator::{ builder::pdb::PodDisruptionBudgetBuilder, client::Client, cluster_resources::ClusterResources, commons::pdb::PdbConfig, kube::ResourceExt, }; -use crate::{hbase_controller::HBASE_CONTROLLER_NAME, OPERATOR_NAME}; +use crate::{ + crd::{HbaseCluster, HbaseRole, APP_NAME}, + hbase_controller::HBASE_CONTROLLER_NAME, + OPERATOR_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 790923dc..4807914b 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -1,5 +1,4 @@ use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_hbase_crd::{Container, HbaseCluster}; use stackable_operator::{ builder::configmap::ConfigMapBuilder, client::Client, @@ -15,7 +14,10 @@ use stackable_operator::{ role_utils::RoleGroupRef, }; -use crate::hbase_controller::MAX_HBASE_LOG_FILES_SIZE; +use crate::{ + crd::{Container, HbaseCluster}, + hbase_controller::MAX_HBASE_LOG_FILES_SIZE, +}; #[derive(Snafu, Debug)] pub enum Error { @@ -35,7 +37,7 @@ pub enum Error { }, #[snafu(display("crd validation failure"))] - CrdValidationFailure { source: stackable_hbase_crd::Error }, + CrdValidationFailure { source: crate::crd::Error }, #[snafu(display("vectorAggregatorConfigMapName must be set"))] MissingVectorAggregatorAddress, diff --git a/rust/operator-binary/src/security/opa.rs b/rust/operator-binary/src/security/opa.rs index 07c56113..2902f6b7 100644 --- a/rust/operator-binary/src/security/opa.rs +++ b/rust/operator-binary/src/security/opa.rs @@ -1,7 +1,8 @@ use snafu::{ResultExt, Snafu}; -use stackable_hbase_crd::{security::AuthorizationConfig, HbaseCluster}; use stackable_operator::{client::Client, commons::opa::OpaApiVersion}; +use crate::crd::{security::AuthorizationConfig, HbaseCluster}; + const DEFAULT_DRY_RUN: bool = false; const DEFAULT_CACHE_ACTIVE: bool = true; const DEFAULT_CACHE_SECONDS: i32 = 5 * 60; // 5 minutes diff --git a/rust/operator-binary/src/zookeeper.rs b/rust/operator-binary/src/zookeeper.rs index e420c2ab..7f3a4887 100644 --- a/rust/operator-binary/src/zookeeper.rs +++ b/rust/operator-binary/src/zookeeper.rs @@ -1,13 +1,14 @@ use std::{collections::BTreeMap, num::ParseIntError}; use snafu::{OptionExt, ResultExt, Snafu}; -use stackable_hbase_crd::HbaseCluster; use stackable_operator::{ client::Client, k8s_openapi::api::core::v1::ConfigMap, kube::ResourceExt, }; use strum::{EnumDiscriminants, IntoStaticStr}; use tracing::warn; +use crate::crd::HbaseCluster; + const ZOOKEEPER_DISCOVERY_CM_HOSTS_ENTRY: &str = "ZOOKEEPER_HOSTS"; const ZOOKEEPER_DISCOVERY_CM_CHROOT_ENTRY: &str = "ZOOKEEPER_CHROOT"; const ZOOKEEPER_DISCOVERY_CM_CLIENT_PORT_ENTRY: &str = "ZOOKEEPER_CLIENT_PORT"; From 9139c871414a8f276edc2de7f9ce615b72dc3937 Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 4 Feb 2025 15:18:56 +0100 Subject: [PATCH 2/7] chore: Remove redundant Clippy allow attributes --- rust/operator-binary/src/hbase_controller.rs | 1 - rust/operator-binary/src/zookeeper.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 3545c961..8c0c345d 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -114,7 +114,6 @@ pub struct Ctx { #[derive(Snafu, Debug, EnumDiscriminants)] #[strum_discriminants(derive(IntoStaticStr))] -#[allow(clippy::enum_variant_names)] pub enum Error { #[snafu(display("missing secret lifetime"))] MissingSecretLifetime, diff --git a/rust/operator-binary/src/zookeeper.rs b/rust/operator-binary/src/zookeeper.rs index 7f3a4887..18317e0d 100644 --- a/rust/operator-binary/src/zookeeper.rs +++ b/rust/operator-binary/src/zookeeper.rs @@ -19,7 +19,6 @@ const ZOOKEEPER_ZNODE_PARENT: &str = "zookeeper.znode.parent"; #[derive(Snafu, Debug, EnumDiscriminants)] #[strum_discriminants(derive(IntoStaticStr))] -#[allow(clippy::enum_variant_names)] pub enum Error { #[snafu(display("object defines no namespace"))] ObjectHasNoNamespace, From e1569143fb2e503b9fb38b31d92382a5d867d00f Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 4 Feb 2025 15:51:46 +0100 Subject: [PATCH 3/7] chore: Version HbaseCluster --- Cargo.lock | 298 +++- Cargo.nix | 1346 +++++++++++++++--- Cargo.toml | 6 +- crate-hashes.json | 3 + rust/operator-binary/Cargo.toml | 6 +- rust/operator-binary/src/config/jvm.rs | 5 +- rust/operator-binary/src/crd/affinity.rs | 5 +- rust/operator-binary/src/crd/mod.rs | 111 +- rust/operator-binary/src/discovery.rs | 6 +- rust/operator-binary/src/hbase_controller.rs | 45 +- rust/operator-binary/src/kerberos.rs | 22 +- rust/operator-binary/src/main.rs | 10 +- rust/operator-binary/src/operations/pdb.rs | 4 +- rust/operator-binary/src/product_logging.rs | 6 +- rust/operator-binary/src/security/opa.rs | 4 +- rust/operator-binary/src/zookeeper.rs | 4 +- 16 files changed, 1538 insertions(+), 343 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85e751ac..cb643fa6 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" @@ -780,7 +804,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", @@ -793,6 +817,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" @@ -1171,7 +1205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.2", ] [[package]] @@ -1201,6 +1235,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" @@ -1237,18 +1280,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" @@ -1262,6 +1332,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" @@ -1272,6 +1353,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" @@ -1286,17 +1381,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]] @@ -1319,9 +1475,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", @@ -1337,6 +1493,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" @@ -1346,8 +1520,8 @@ dependencies = [ "chrono", "form_urlencoded", "http", - "json-patch", - "k8s-openapi", + "json-patch 3.0.1", + "k8s-openapi 0.24.0", "schemars", "serde", "serde-value", @@ -1355,6 +1529,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" @@ -1368,6 +1555,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" @@ -1381,12 +1596,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", @@ -1856,7 +2071,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags", + "bitflags 2.8.0", ] [[package]] @@ -2102,7 +2317,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", @@ -2115,7 +2330,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", @@ -2347,6 +2562,7 @@ dependencies = [ "serde_yaml", "snafu 0.8.5", "stackable-operator", + "stackable-versioned", "strum", "tokio", "tracing", @@ -2366,9 +2582,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", @@ -2406,13 +2622,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 = "strsim" version = "0.11.1" @@ -2704,7 +2944,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", @@ -2856,6 +3096,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +[[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 e155ff58..e153d11c 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-hbase-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-hbase-crd" = rec { - packageId = "stackable-hbase-crd"; - build = internal.buildRustCrateWithFeatures { - packageId = "stackable-hbase-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-hbase-operator" = rec { packageId = "stackable-hbase-operator"; build = internal.buildRustCrateWithFeatures { @@ -655,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"; @@ -1086,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"; @@ -1767,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"; @@ -2220,7 +2276,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "libc"; @@ -2261,7 +2317,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"; @@ -3531,7 +3626,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown"; + packageId = "hashbrown 0.15.2"; usesDefaultFeatures = false; } ]; @@ -3605,6 +3700,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"; @@ -3686,7 +3802,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"; @@ -3698,7 +3855,7 @@ rec { dependencies = [ { name = "jsonptr"; - packageId = "jsonptr"; + packageId = "jsonptr 0.6.3"; } { name = "serde"; @@ -3727,7 +3884,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"; @@ -3760,7 +3958,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"; @@ -3794,12 +4029,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 " @@ -3841,62 +4076,149 @@ 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" ]; + "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" ]; @@ -3919,11 +4241,83 @@ rec { }; resolvedDefaultFeatures = [ "client" "config" "derive" "jsonpatch" "kube-client" "kube-derive" "kube-runtime" "runtime" "rustls-tls" ]; }; - "kube-client" = rec { - crateName = "kube-client"; + "kube 0.98.0" = rec { + crateName = "kube"; version = "0.98.0"; edition = "2021"; - sha256 = "1jd06xwhnmzrzqrfwq7jlmmxl7dvaygmchjx363zmlgvrlwasd4x"; + 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 " @@ -4010,17 +4404,17 @@ rec { } { name = "jsonpath-rust"; - packageId = "jsonpath-rust"; + packageId = "jsonpath-rust 0.5.1"; optional = true; } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; usesDefaultFeatures = false; } { name = "kube-core"; - packageId = "kube-core"; + packageId = "kube-core 0.96.0"; } { name = "pem"; @@ -4058,7 +4452,7 @@ rec { } { name = "thiserror"; - packageId = "thiserror 2.0.11"; + packageId = "thiserror 1.0.69"; } { name = "tokio"; @@ -4098,14 +4492,9 @@ rec { usesDefaultFeatures = false; features = [ "async-await" ]; } - { - name = "hyper"; - packageId = "hyper"; - features = [ "server" ]; - } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -4166,12 +4555,487 @@ 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" = rec { - crateName = "kube-core"; + "kube-client 0.98.0" = rec { + crateName = "kube-client"; version = "0.98.0"; edition = "2021"; - sha256 = "1wwnsn1wk7bd2jiv9iw8446j0bczagqv1lc4wy88l5wa505q7alp"; - libName = "kube_core"; + sha256 = "1jd06xwhnmzrzqrfwq7jlmmxl7dvaygmchjx363zmlgvrlwasd4x"; + 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.7.5"; + optional = true; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; + usesDefaultFeatures = false; + } + { + name = "kube-core"; + packageId = "kube-core 0.98.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 2.0.11"; + } + { + 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 = "hyper"; + packageId = "hyper"; + features = [ "server" ]; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.24.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-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 { + crateName = "kube-core"; + version = "0.98.0"; + edition = "2021"; + sha256 = "1wwnsn1wk7bd2jiv9iw8446j0bczagqv1lc4wy88l5wa505q7alp"; + 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 3.0.1"; + optional = true; + } + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.24.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 2.0.11"; + } + ]; + devDependencies = [ + { + name = "k8s-openapi"; + packageId = "k8s-openapi 0.24.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-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"; + sha256 = "0n46p76pvm3plsnbm57c2j76r1i6hwslxsaj345pxdvn8255sx1p"; + 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-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 " @@ -4179,42 +5043,71 @@ rec { ]; dependencies = [ { - name = "chrono"; - packageId = "chrono"; + 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 = [ "now" ]; + features = [ "Clone" "Debug" "Hash" "PartialEq" ]; } { - name = "form_urlencoded"; - packageId = "form_urlencoded"; + name = "futures"; + packageId = "futures 0.3.31"; + usesDefaultFeatures = false; + features = [ "async-await" ]; } { - name = "http"; - packageId = "http"; + name = "hashbrown"; + packageId = "hashbrown 0.14.5"; } { name = "json-patch"; - packageId = "json-patch"; - optional = true; + packageId = "json-patch 2.0.0"; + } + { + name = "jsonptr"; + packageId = "jsonptr 0.4.7"; } { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; usesDefaultFeatures = false; } { - name = "schemars"; - packageId = "schemars"; - optional = true; + name = "kube-client"; + packageId = "kube-client 0.96.0"; + usesDefaultFeatures = false; + features = [ "jsonpatch" "client" ]; } { - name = "serde"; - packageId = "serde"; - features = [ "derive" ]; + name = "parking_lot"; + packageId = "parking_lot"; } { - name = "serde-value"; - packageId = "serde-value"; + name = "pin-project"; + packageId = "pin-project"; + } + { + name = "serde"; + packageId = "serde"; } { name = "serde_json"; @@ -4222,65 +5115,45 @@ rec { } { name = "thiserror"; - packageId = "thiserror 2.0.11"; + packageId = "thiserror 1.0.69"; } - ]; - devDependencies = [ { - name = "k8s-openapi"; - packageId = "k8s-openapi"; - usesDefaultFeatures = false; - features = [ "latest" ]; + name = "tokio"; + packageId = "tokio"; + features = [ "time" ]; } - ]; - 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-derive" = rec { - crateName = "kube-derive"; - version = "0.98.0"; - edition = "2021"; - sha256 = "0n46p76pvm3plsnbm57c2j76r1i6hwslxsaj345pxdvn8255sx1p"; - procMacro = true; - libName = "kube_derive"; - authors = [ - "clux " - "Natalie Klestrup Röijezon " - "kazk " - ]; - dependencies = [ { - name = "darling"; - packageId = "darling"; + name = "tokio-util"; + packageId = "tokio-util"; + features = [ "time" ]; } { - name = "proc-macro2"; - packageId = "proc-macro2"; + name = "tracing"; + packageId = "tracing"; } + ]; + devDependencies = [ { - name = "quote"; - packageId = "quote"; + name = "k8s-openapi"; + packageId = "k8s-openapi 0.23.0"; + usesDefaultFeatures = false; + features = [ "latest" ]; } { name = "serde_json"; packageId = "serde_json"; } { - name = "syn"; - packageId = "syn 2.0.96"; - features = [ "extra-traits" ]; + name = "tokio"; + packageId = "tokio"; + features = [ "full" "test-util" ]; } ]; - + features = { + "unstable-runtime" = [ "unstable-runtime-subscribe" "unstable-runtime-stream-control" "unstable-runtime-reconcile-on" ]; + }; }; - "kube-runtime" = rec { + "kube-runtime 0.98.0" = rec { crateName = "kube-runtime"; version = "0.98.0"; edition = "2021"; @@ -4326,7 +5199,7 @@ rec { } { name = "hashbrown"; - packageId = "hashbrown"; + packageId = "hashbrown 0.15.2"; } { name = "hostname"; @@ -4334,20 +5207,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" ]; } @@ -4389,7 +5262,7 @@ rec { devDependencies = [ { name = "k8s-openapi"; - packageId = "k8s-openapi"; + packageId = "k8s-openapi 0.24.0"; usesDefaultFeatures = false; features = [ "latest" ]; } @@ -5766,7 +6639,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } ]; features = { @@ -6547,7 +7420,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "core-foundation"; @@ -6594,7 +7467,7 @@ rec { dependencies = [ { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "core-foundation"; @@ -7227,63 +8100,6 @@ rec { }; resolvedDefaultFeatures = [ "alloc" ]; }; - "stackable-hbase-crd" = rec { - crateName = "stackable-hbase-crd"; - version = "0.0.0-dev"; - edition = "2021"; - src = lib.cleanSourceWith { filter = sourceFilter; src = ./rust/crd; }; - libName = "stackable_hbase_crd"; - authors = [ - "Stackable GmbH " - ]; - dependencies = [ - { - name = "product-config"; - packageId = "product-config"; - } - { - 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 = "indoc"; - packageId = "indoc"; - } - { - name = "rstest"; - packageId = "rstest"; - } - { - name = "serde_yaml"; - packageId = "serde_yaml"; - } - ]; - - }; "stackable-hbase-operator" = rec { crateName = "stackable-hbase-operator"; version = "0.0.0-dev"; @@ -7335,17 +8151,22 @@ rec { features = [ "derive" ]; } { - name = "snafu"; - packageId = "snafu 0.8.5"; + name = "serde_json"; + packageId = "serde_json"; } { - name = "stackable-hbase-crd"; - packageId = "stackable-hbase-crd"; + name = "snafu"; + packageId = "snafu 0.8.5"; } { name = "stackable-operator"; packageId = "stackable-operator"; } + { + name = "stackable-versioned"; + packageId = "stackable-versioned"; + features = [ "k8s" ]; + } { name = "strum"; packageId = "strum"; @@ -7437,17 +8258,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" ]; } @@ -7592,7 +8413,7 @@ rec { dependencies = [ { name = "kube"; - packageId = "kube"; + packageId = "kube 0.98.0"; usesDefaultFeatures = false; features = [ "client" "jsonpatch" "runtime" "derive" "rustls-tls" ]; } @@ -7616,6 +8437,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" ]; + }; "strsim" = rec { crateName = "strsim"; version = "0.11.1"; @@ -8569,7 +9490,7 @@ rec { } { name = "bitflags"; - packageId = "bitflags"; + packageId = "bitflags 2.8.0"; } { name = "bytes"; @@ -9161,6 +10082,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 2a22c294..6c93b80d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,10 @@ edition = "2021" repository = "https://github.com/stackabletech/hbase-operator" [workspace.dependencies] +stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" } +product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } + anyhow = "1.0" built = { version = "0.7", features = ["chrono", "git2"] } clap = "4.5" @@ -22,8 +26,6 @@ serde = { version = "1.0", features = ["derive"] } 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" } -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"] } tracing = "0.1" 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 98f44c83..9ce1de05 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -9,17 +9,19 @@ repository.workspace = true publish = false [dependencies] +stackable-versioned.workspace = true +stackable-operator.workspace = true +product-config.workspace = true + anyhow.workspace = true clap.workspace = true const_format.workspace = true fnv.workspace = true futures.workspace = true indoc.workspace = true -product-config.workspace = true serde.workspace = true serde_json.workspace = true snafu.workspace = true -stackable-operator.workspace = true strum.workspace = true tokio.workspace = true tracing.workspace = true diff --git a/rust/operator-binary/src/config/jvm.rs b/rust/operator-binary/src/config/jvm.rs index c83be205..4856385c 100644 --- a/rust/operator-binary/src/config/jvm.rs +++ b/rust/operator-binary/src/config/jvm.rs @@ -130,7 +130,7 @@ fn is_heap_jvm_argument(jvm_argument: &str) -> bool { #[cfg(test)] mod tests { use super::*; - use crate::crd::{HbaseCluster, HbaseRole}; + use crate::crd::{v1alpha1, HbaseRole}; #[test] fn test_construct_jvm_arguments_defaults() { @@ -254,7 +254,8 @@ mod tests { String, String, ) { - let hbase: HbaseCluster = serde_yaml::from_str(hbase_cluster).expect("illegal test input"); + let hbase: v1alpha1::HbaseCluster = + serde_yaml::from_str(hbase_cluster).expect("illegal test input"); let hbase_role = HbaseRole::RegionServer; let merged_config = hbase diff --git a/rust/operator-binary/src/crd/affinity.rs b/rust/operator-binary/src/crd/affinity.rs index 269efdfd..db455537 100644 --- a/rust/operator-binary/src/crd/affinity.rs +++ b/rust/operator-binary/src/crd/affinity.rs @@ -91,7 +91,7 @@ mod tests { }; use super::*; - use crate::HbaseCluster; + use crate::crd::v1alpha1; #[rstest] #[case(HbaseRole::Master)] @@ -122,7 +122,8 @@ mod tests { default: replicas: 1 "#; - let hbase: HbaseCluster = serde_yaml::from_str(input).expect("illegal test input"); + let hbase: v1alpha1::HbaseCluster = + serde_yaml::from_str(input).expect("illegal test input"); let merged_config = hbase .merged_config( &role, diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 19c2636b..f383ded1 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -26,6 +26,7 @@ use stackable_operator::{ status::condition::{ClusterCondition, HasStatusCondition}, time::Duration, }; +use stackable_versioned::versioned; use strum::{Display, EnumIter, EnumString}; use crate::crd::{affinity::get_affinity, security::AuthorizationConfig}; @@ -72,6 +73,55 @@ pub const HBASE_REST_UI_PORT: u16 = 8085; // Newer versions use the same port as the UI because Hbase provides it's own metrics API pub const METRICS_PORT: u16 = 9100; +#[versioned(version(name = "v1alpha1"))] +pub mod versioned { + /// An HBase cluster stacklet. This resource is managed by the Stackable operator for Apache HBase. + /// Find more information on how to use it and the resources that the operator generates in the + /// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/hbase/). + /// + /// The CRD contains three roles: `masters`, `regionServers` and `restServers`. + #[versioned(k8s( + group = "hbase.stackable.tech", + kind = "HbaseCluster", + plural = "hbaseclusters", + shortname = "hbase", + status = "HbaseClusterStatus", + namespaced, + crates( + kube_core = "stackable_operator::kube::core", + k8s_openapi = "stackable_operator::k8s_openapi", + schemars = "stackable_operator::schemars" + ) + ))] + #[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct HbaseClusterSpec { + // no doc string - See ProductImage struct + pub image: ProductImage, + + /// Configuration that applies to all roles and role groups. + /// This includes settings for logging, ZooKeeper and HDFS connection, among other things. + pub cluster_config: HbaseClusterConfig, + + // no doc string - See ClusterOperation struct + #[serde(default)] + pub cluster_operation: ClusterOperation, + + /// The HBase master process is responsible for assigning regions to region servers and + /// manages the cluster. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub masters: Option>, + + /// Region servers hold the data and handle requests from clients for their region. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region_servers: Option>, + + /// Rest servers provide a REST API to interact with. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rest_servers: Option>, + } +} + #[derive(Snafu, Debug)] pub enum Error { #[snafu(display("the role [{role}] is invalid and does not exist in HBase"))] @@ -90,53 +140,6 @@ pub enum Error { FragmentValidationFailure { source: ValidationError }, } -/// An HBase cluster stacklet. This resource is managed by the Stackable operator for Apache HBase. -/// Find more information on how to use it and the resources that the operator generates in the -/// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/hbase/). -/// -/// The CRD contains three roles: `masters`, `regionServers` and `restServers`. -#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] -#[kube( - group = "hbase.stackable.tech", - version = "v1alpha1", - kind = "HbaseCluster", - plural = "hbaseclusters", - shortname = "hbase", - status = "HbaseClusterStatus", - namespaced, - crates( - kube_core = "stackable_operator::kube::core", - k8s_openapi = "stackable_operator::k8s_openapi", - schemars = "stackable_operator::schemars" - ) -)] -#[serde(rename_all = "camelCase")] -pub struct HbaseClusterSpec { - // no doc string - See ProductImage struct - pub image: ProductImage, - - /// Configuration that applies to all roles and role groups. - /// This includes settings for logging, ZooKeeper and HDFS connection, among other things. - pub cluster_config: HbaseClusterConfig, - - // no doc string - See ClusterOperation struct - #[serde(default)] - pub cluster_operation: ClusterOperation, - - /// The HBase master process is responsible for assigning regions to region servers and - /// manages the cluster. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub masters: Option>, - - /// Region servers hold the data and handle requests from clients for their region. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub region_servers: Option>, - - /// Rest servers provide a REST API to interact with. - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rest_servers: Option>, -} - #[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct HbaseClusterConfig { @@ -422,7 +425,7 @@ pub struct HbaseConfig { } impl Configuration for HbaseConfigFragment { - type Configurable = HbaseCluster; + type Configurable = v1alpha1::HbaseCluster; fn compute_env( &self, @@ -499,7 +502,7 @@ pub struct HbaseClusterStatus { pub conditions: Vec, } -impl HasStatusCondition for HbaseCluster { +impl HasStatusCondition for v1alpha1::HbaseCluster { fn conditions(&self) -> Vec { match &self.status { Some(status) => status.conditions.clone(), @@ -508,7 +511,7 @@ impl HasStatusCondition for HbaseCluster { } } -impl HbaseCluster { +impl v1alpha1::HbaseCluster { /// The name of the role-level load-balanced Kubernetes `Service` pub fn server_role_service_name(&self) -> Option { self.metadata.name.clone() @@ -519,7 +522,7 @@ impl HbaseCluster { &self, role_name: impl Into, group_name: impl Into, - ) -> RoleGroupRef { + ) -> RoleGroupRef { RoleGroupRef { cluster: ObjectRef::from_obj(self), role: role_name.into(), @@ -541,7 +544,7 @@ impl HbaseCluster { /// Get the RoleGroup struct for the given ref pub fn get_role_group( &self, - rolegroup_ref: &RoleGroupRef, + rolegroup_ref: &RoleGroupRef, ) -> Result<&RoleGroup, Error> { let role_variant = HbaseRole::from_str(&rolegroup_ref.role).with_context(|_| InvalidRoleSnafu { @@ -708,7 +711,7 @@ mod tests { transform_all_roles_to_config, validate_all_roles_and_groups_config, }; - use crate::crd::{merged_env, HbaseCluster, HbaseRole}; + use super::*; #[test] pub fn test_env_overrides() { @@ -754,7 +757,7 @@ spec: "#}; let deserializer = serde_yaml::Deserializer::from_str(input); - let hbase: HbaseCluster = + let hbase: v1alpha1::HbaseCluster = serde_yaml::with::singleton_map_recursive::deserialize(deserializer).unwrap(); let roles = HashMap::from([( diff --git a/rust/operator-binary/src/discovery.rs b/rust/operator-binary/src/discovery.rs index e8241614..3b55ac8f 100644 --- a/rust/operator-binary/src/discovery.rs +++ b/rust/operator-binary/src/discovery.rs @@ -11,7 +11,7 @@ use stackable_operator::{ }; use crate::{ - crd::{HbaseCluster, HbaseRole, HBASE_SITE_XML}, + crd::{v1alpha1, HbaseRole, HBASE_SITE_XML}, hbase_controller::build_recommended_labels, kerberos::{self, kerberos_discovery_config_properties}, zookeeper::ZookeeperConnectionInformation, @@ -24,7 +24,7 @@ pub enum Error { #[snafu(display("object {hbase} is missing metadata to build owner reference"))] ObjectMissingMetadataForOwnerRef { source: stackable_operator::builder::meta::Error, - hbase: ObjectRef, + hbase: ObjectRef, }, #[snafu(display("failed to build ConfigMap"))] @@ -43,7 +43,7 @@ pub enum Error { /// Creates a discovery config map containing the `hbase-site.xml` for clients. pub fn build_discovery_configmap( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, cluster_info: &KubernetesClusterInfo, zookeeper_connection_information: &ZookeeperConnectionInformation, resolved_product_image: &ResolvedProductImage, diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 8c0c345d..c7288190 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -72,7 +72,7 @@ use crate::{ construct_role_specific_non_heap_jvm_args, }, crd::{ - merged_env, Container, HbaseCluster, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment, + merged_env, v1alpha1, Container, HbaseClusterStatus, HbaseConfig, HbaseConfigFragment, HbaseRole, APP_NAME, CONFIG_DIR_NAME, HBASE_ENV_SH, HBASE_REST_PORT_NAME_HTTP, HBASE_REST_PORT_NAME_HTTPS, HBASE_SITE_XML, JVM_SECURITY_PROPERTIES_FILE, SSL_CLIENT_XML, SSL_SERVER_XML, @@ -154,7 +154,7 @@ 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 apply discovery configmap"))] @@ -168,19 +168,19 @@ pub enum Error { #[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"))] @@ -265,7 +265,7 @@ pub enum Error { ))] SerializeJvmSecurity { source: PropertiesWriterError, - rolegroup: RoleGroupRef, + rolegroup: RoleGroupRef, }, #[snafu(display("failed to create PodDisruptionBudget"))] @@ -327,7 +327,7 @@ impl ReconcilerError for Error { } pub async fn reconcile_hbase( - hbase: Arc>, + hbase: Arc>, ctx: Arc, ) -> Result { tracing::info!("Starting reconcile"); @@ -520,7 +520,7 @@ pub async fn reconcile_hbase( /// 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. pub fn build_region_server_role_service( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, resolved_product_image: &ResolvedProductImage, ) -> Result { let role = HbaseRole::RegionServer; @@ -573,10 +573,10 @@ pub fn build_region_server_role_service( /// The rolegroup [`ConfigMap`] configures the rolegroup based on the configuration given by the administrator #[allow(clippy::too_many_arguments)] fn build_rolegroup_config_map( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, cluster_info: &KubernetesClusterInfo, role: &Role, - rolegroup: &RoleGroupRef, + rolegroup: &RoleGroupRef, rolegroup_config: &HashMap>, zookeeper_connection_information: &ZookeeperConnectionInformation, merged_config: &HbaseConfig, @@ -729,9 +729,9 @@ fn build_rolegroup_config_map( /// /// This is mostly useful for internal communication between peers, or for clients that perform client-side load balancing. fn build_rolegroup_service( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, hbase_role: &HbaseRole, - rolegroup: &RoleGroupRef, + rolegroup: &RoleGroupRef, resolved_product_image: &ResolvedProductImage, ) -> Result { let ports = hbase @@ -788,9 +788,9 @@ fn build_rolegroup_service( /// /// The [`Pod`](`stackable_operator::k8s_openapi::api::core::v1::Pod`)s are accessible through the corresponding [`Service`] (from [`build_rolegroup_service`]). fn build_rolegroup_statefulset( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, hbase_role: &HbaseRole, - rolegroup_ref: &RoleGroupRef, + rolegroup_ref: &RoleGroupRef, rolegroup_config: &HashMap>, merged_config: &HbaseConfig, resolved_product_image: &ResolvedProductImage, @@ -1092,7 +1092,7 @@ fn build_rolegroup_statefulset( // The result type is only defined once, there is no value in extracting it into a type definition. #[allow(clippy::type_complexity)] fn build_roles( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, ) -> Result< HashMap< String, @@ -1155,7 +1155,7 @@ where } pub fn error_policy( - _obj: Arc>, + _obj: Arc>, error: &Error, _ctx: Arc, ) -> Action { @@ -1167,11 +1167,11 @@ pub fn error_policy( } pub fn build_recommended_labels<'a>( - owner: &'a HbaseCluster, + owner: &'a v1alpha1::HbaseCluster, app_version: &'a str, role: &'a str, role_group: &'a str, -) -> ObjectLabels<'a, HbaseCluster> { +) -> ObjectLabels<'a, v1alpha1::HbaseCluster> { ObjectLabels { owner, app_name: APP_NAME, @@ -1185,7 +1185,7 @@ pub fn build_recommended_labels<'a>( /// The content of the HBase `hbase-env.sh` file. fn build_hbase_env_sh( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, merged_config: &HbaseConfig, hbase_role: &HbaseRole, role: &Role, @@ -1240,7 +1240,7 @@ fn build_hbase_env_sh( /// In the future, such validations should be moved to the CRD CEL rules which are much more flexible /// and have to added benefit that invalid CRs are rejected by the API server. /// A requirement for this is that the minimum supported Kubernetes version is 1.29. -fn validate_cr(hbase: &HbaseCluster) -> Result<()> { +fn validate_cr(hbase: &v1alpha1::HbaseCluster) -> Result<()> { tracing::info!("Begin CR validation"); let hbase_version = hbase.spec.image.product_version(); @@ -1300,7 +1300,8 @@ mod test { replicas: 1 " ); - let hbase: HbaseCluster = serde_yaml::from_str(&input).expect("illegal test input"); + let hbase: v1alpha1::HbaseCluster = + serde_yaml::from_str(&input).expect("illegal test input"); let resolved_image = ResolvedProductImage { image: format!("oci.stackable.tech/sdp/hbase:{hbase_version}-stackable0.0.0-dev"), @@ -1311,7 +1312,7 @@ mod test { }; let role_group_ref = RoleGroupRef { - cluster: ObjectRef::::from_obj(&hbase), + cluster: ObjectRef::::from_obj(&hbase), role: role.to_string(), role_group: "default".to_string(), }; diff --git a/rust/operator-binary/src/kerberos.rs b/rust/operator-binary/src/kerberos.rs index d488e7f3..f3d9a805 100644 --- a/rust/operator-binary/src/kerberos.rs +++ b/rust/operator-binary/src/kerberos.rs @@ -16,14 +16,14 @@ use stackable_operator::{ utils::cluster_info::KubernetesClusterInfo, }; -use crate::crd::{ - HbaseCluster, HbaseRole, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME, -}; +use crate::crd::{v1alpha1, HbaseRole, TLS_STORE_DIR, TLS_STORE_PASSWORD, TLS_STORE_VOLUME_NAME}; #[derive(Snafu, Debug)] pub enum Error { #[snafu(display("object {hbase} is missing namespace"))] - ObjectMissingNamespace { hbase: ObjectRef }, + ObjectMissingNamespace { + hbase: ObjectRef, + }, #[snafu(display("failed to add Kerberos secret volume"))] AddKerberosSecretVolume { @@ -45,7 +45,7 @@ pub enum Error { } pub fn kerberos_config_properties( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, cluster_info: &KubernetesClusterInfo, ) -> Result, Error> { if !hbase.has_kerberos_enabled() { @@ -138,7 +138,7 @@ pub fn kerberos_config_properties( } pub fn kerberos_discovery_config_properties( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, cluster_info: &KubernetesClusterInfo, ) -> Result, Error> { if !hbase.has_kerberos_enabled() { @@ -178,7 +178,7 @@ pub fn kerberos_discovery_config_properties( ])) } -pub fn kerberos_ssl_server_settings(hbase: &HbaseCluster) -> BTreeMap { +pub fn kerberos_ssl_server_settings(hbase: &v1alpha1::HbaseCluster) -> BTreeMap { if !hbase.has_https_enabled() { return BTreeMap::new(); } @@ -208,7 +208,7 @@ pub fn kerberos_ssl_server_settings(hbase: &HbaseCluster) -> BTreeMap BTreeMap { +pub fn kerberos_ssl_client_settings(hbase: &v1alpha1::HbaseCluster) -> BTreeMap { if !hbase.has_https_enabled() { return BTreeMap::new(); } @@ -230,7 +230,7 @@ pub fn kerberos_ssl_client_settings(hbase: &HbaseCluster) -> BTreeMap String { +pub fn kerberos_container_start_commands(hbase: &v1alpha1::HbaseCluster) -> String { if !hbase.has_kerberos_enabled() { return String::new(); } @@ -292,7 +292,7 @@ pub fn kerberos_container_start_commands(hbase: &HbaseCluster) -> String { } fn principal_host_part( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, cluster_info: &KubernetesClusterInfo, ) -> Result { let hbase_name = hbase.name_any(); diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 9abdaec0..dc13d535 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -14,10 +14,11 @@ use stackable_operator::{ }, }, logging::controller::report_controller_reconciled, - CustomResourceExt, + shared::yaml::SerializeOptions, + YamlSchema, }; -use crate::crd::{HbaseCluster, APP_NAME}; +use crate::crd::{v1alpha1, HbaseCluster, APP_NAME}; mod config; mod crd; @@ -47,7 +48,8 @@ async fn main() -> anyhow::Result<()> { let opts = Opts::parse(); match opts.cmd { Command::Crd => { - HbaseCluster::print_yaml_schema(built_info::PKG_VERSION)?; + HbaseCluster::merged_crd(HbaseCluster::V1Alpha1)? + .print_yaml_schema(built_info::PKG_VERSION, SerializeOptions::default())?; } Command::Run(ProductOperatorRun { product_config, @@ -87,7 +89,7 @@ async fn main() -> anyhow::Result<()> { )); Controller::new( - watch_namespace.get_api::>(&client), + watch_namespace.get_api::>(&client), watcher::Config::default(), ) .owns( diff --git a/rust/operator-binary/src/operations/pdb.rs b/rust/operator-binary/src/operations/pdb.rs index 3d3505db..8350e4aa 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::{HbaseCluster, HbaseRole, APP_NAME}, + crd::{v1alpha1, HbaseRole, APP_NAME}, hbase_controller::HBASE_CONTROLLER_NAME, OPERATOR_NAME, }; @@ -27,7 +27,7 @@ pub enum Error { pub async fn add_pdbs( pdb: &PdbConfig, - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, role: &HbaseRole, 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 4807914b..ef0c6d16 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -15,7 +15,7 @@ use stackable_operator::{ }; use crate::{ - crd::{Container, HbaseCluster}, + crd::{v1alpha1, Container}, hbase_controller::MAX_HBASE_LOG_FILES_SIZE, }; @@ -56,7 +56,7 @@ pub const STACKABLE_LOG_DIR: &str = "/stackable/log"; /// 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( - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, client: &Client, ) -> Result> { let vector_aggregator_address = if let Some(vector_aggregator_config_map_name) = @@ -90,7 +90,7 @@ pub async fn resolve_vector_aggregator_address( /// Extend the role group ConfigMap with logging and Vector configurations pub fn extend_role_group_config_map( - rolegroup: &RoleGroupRef, + rolegroup: &RoleGroupRef, vector_aggregator_address: Option<&str>, logging: &Logging, cm_builder: &mut ConfigMapBuilder, diff --git a/rust/operator-binary/src/security/opa.rs b/rust/operator-binary/src/security/opa.rs index 2902f6b7..ec6c4c9b 100644 --- a/rust/operator-binary/src/security/opa.rs +++ b/rust/operator-binary/src/security/opa.rs @@ -1,7 +1,7 @@ use snafu::{ResultExt, Snafu}; use stackable_operator::{client::Client, commons::opa::OpaApiVersion}; -use crate::crd::{security::AuthorizationConfig, HbaseCluster}; +use crate::crd::{security::AuthorizationConfig, v1alpha1}; const DEFAULT_DRY_RUN: bool = false; const DEFAULT_CACHE_ACTIVE: bool = true; @@ -48,7 +48,7 @@ impl HbaseOpaConfig { } pub async fn from_opa_config( client: &Client, - hbase: &HbaseCluster, + hbase: &v1alpha1::HbaseCluster, authorization_config: &AuthorizationConfig, ) -> Result { let authorization_connection_string = authorization_config diff --git a/rust/operator-binary/src/zookeeper.rs b/rust/operator-binary/src/zookeeper.rs index 18317e0d..ba5e0949 100644 --- a/rust/operator-binary/src/zookeeper.rs +++ b/rust/operator-binary/src/zookeeper.rs @@ -7,7 +7,7 @@ use stackable_operator::{ use strum::{EnumDiscriminants, IntoStaticStr}; use tracing::warn; -use crate::crd::HbaseCluster; +use crate::crd::v1alpha1; const ZOOKEEPER_DISCOVERY_CM_HOSTS_ENTRY: &str = "ZOOKEEPER_HOSTS"; const ZOOKEEPER_DISCOVERY_CM_CHROOT_ENTRY: &str = "ZOOKEEPER_CHROOT"; @@ -53,7 +53,7 @@ pub struct ZookeeperConnectionInformation { } impl ZookeeperConnectionInformation { - pub async fn retrieve(hbase: &HbaseCluster, client: &Client) -> Result { + pub async fn retrieve(hbase: &v1alpha1::HbaseCluster, client: &Client) -> Result { let zk_discovery_cm_name = &hbase.spec.cluster_config.zookeeper_config_map_name; let mut zk_discovery_cm = client .get::( From 8cbc8f7e81b60209a478c80e9198e32a221d276a Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 4 Feb 2025 15:56:01 +0100 Subject: [PATCH 4/7] docs: Fix invalid rustdoc reference --- rust/operator-binary/src/hbase_controller.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index c7288190..601a6413 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -1,4 +1,6 @@ -//! Ensures that `Pod`s are configured and running for each [`HbaseCluster`] +//! Ensures that `Pod`s are configured and running for each [`HbaseCluster`][v1alpha1] +//! +//! [v1alpha1]: crate::crd::v1alpha1::HbaseCluster use std::{ collections::{BTreeMap, HashMap}, fmt::Write, From bbd3a71141b1434d26c7655fecbffcd539703243 Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 4 Feb 2025 16:20:17 +0100 Subject: [PATCH 5/7] chore: Version HbaseClusterConfig --- rust/operator-binary/src/crd/mod.rs | 76 ++++++++++++++--------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index f383ded1..60096cef 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -101,7 +101,7 @@ pub mod versioned { /// Configuration that applies to all roles and role groups. /// This includes settings for logging, ZooKeeper and HDFS connection, among other things. - pub cluster_config: HbaseClusterConfig, + pub cluster_config: v1alpha1::HbaseClusterConfig, // no doc string - See ClusterOperation struct #[serde(default)] @@ -120,6 +120,43 @@ pub mod versioned { #[serde(default, skip_serializing_if = "Option::is_none")] pub rest_servers: Option>, } + + #[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct HbaseClusterConfig { + /// Name of the [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery) + /// for an HDFS cluster. + pub hdfs_config_map_name: String, + + /// 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, + + /// Name of the [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery) + /// for a ZooKeeper cluster. + pub zookeeper_config_map_name: String, + + /// This field controls which type of Service the Operator creates for this HbaseCluster: + /// + /// * 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, + + /// Settings related to user [authentication](DOCS_BASE_URL_PLACEHOLDER/usage-guide/security). + pub authentication: Option, + + #[serde(default, skip_serializing_if = "Option::is_none")] + pub authorization: Option, + } } #[derive(Snafu, Debug)] @@ -140,43 +177,6 @@ pub enum Error { FragmentValidationFailure { source: ValidationError }, } -#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct HbaseClusterConfig { - /// Name of the [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery) - /// for an HDFS cluster. - pub hdfs_config_map_name: String, - - /// 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, - - /// Name of the [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery) - /// for a ZooKeeper cluster. - pub zookeeper_config_map_name: String, - - /// This field controls which type of Service the Operator creates for this HbaseCluster: - /// - /// * 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, - - /// Settings related to user [authentication](DOCS_BASE_URL_PLACEHOLDER/usage-guide/security). - pub authentication: Option, - - #[serde(default, skip_serializing_if = "Option::is_none")] - pub authorization: Option, -} - // TODO: Temporary solution until listener-operator is finished #[derive(Clone, Debug, Default, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "PascalCase")] From 219d332df1fec6f02ef9059eb0673496098b0096 Mon Sep 17 00:00:00 2001 From: Techassi Date: Tue, 4 Feb 2025 16:22:22 +0100 Subject: [PATCH 6/7] chore: Move HbaseCluster impl blocks --- rust/operator-binary/src/crd/mod.rs | 354 ++++++++++++++-------------- 1 file changed, 177 insertions(+), 177 deletions(-) diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 60096cef..89cab0b9 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -159,6 +159,183 @@ pub mod versioned { } } +impl HasStatusCondition for v1alpha1::HbaseCluster { + fn conditions(&self) -> Vec { + match &self.status { + Some(status) => status.conditions.clone(), + None => vec![], + } + } +} + +impl v1alpha1::HbaseCluster { + /// The name of the role-level load-balanced Kubernetes `Service` + pub fn server_role_service_name(&self) -> Option { + self.metadata.name.clone() + } + + /// Metadata about a server rolegroup + pub fn server_rolegroup_ref( + &self, + role_name: impl Into, + group_name: impl Into, + ) -> RoleGroupRef { + RoleGroupRef { + cluster: ObjectRef::from_obj(self), + role: role_name.into(), + role_group: group_name.into(), + } + } + + pub fn get_role( + &self, + role: &HbaseRole, + ) -> Option<&Role> { + match role { + HbaseRole::Master => self.spec.masters.as_ref(), + HbaseRole::RegionServer => self.spec.region_servers.as_ref(), + HbaseRole::RestServer => self.spec.rest_servers.as_ref(), + } + } + + /// Get the RoleGroup struct for the given ref + pub fn get_role_group( + &self, + rolegroup_ref: &RoleGroupRef, + ) -> Result<&RoleGroup, Error> { + let role_variant = + HbaseRole::from_str(&rolegroup_ref.role).with_context(|_| InvalidRoleSnafu { + role: rolegroup_ref.role.to_owned(), + })?; + let role = self + .get_role(&role_variant) + .with_context(|| MissingHbaseRoleSnafu { + role: role_variant.to_string(), + })?; + role.role_groups + .get(&rolegroup_ref.role_group) + .with_context(|| MissingHbaseRoleGroupSnafu { + role_group: rolegroup_ref.role_group.to_owned(), + }) + } + + pub fn role_config(&self, role: &HbaseRole) -> Option<&GenericRoleConfig> { + match role { + HbaseRole::Master => self.spec.masters.as_ref().map(|m| &m.role_config), + HbaseRole::RegionServer => self.spec.region_servers.as_ref().map(|rs| &rs.role_config), + HbaseRole::RestServer => self.spec.rest_servers.as_ref().map(|rs| &rs.role_config), + } + } + + pub fn has_kerberos_enabled(&self) -> bool { + self.kerberos_secret_class().is_some() + } + + pub fn kerberos_secret_class(&self) -> Option { + self.spec + .cluster_config + .authentication + .as_ref() + .map(|a| &a.kerberos) + .map(|k| k.secret_class.clone()) + } + + pub fn has_https_enabled(&self) -> bool { + self.https_secret_class().is_some() + } + + pub fn https_secret_class(&self) -> Option { + self.spec + .cluster_config + .authentication + .as_ref() + .map(|a| a.tls_secret_class.clone()) + } + + /// Returns required port name and port number tuples depending on the role. + /// Hbase versions 2.4.* will have three ports for each role + /// Hbase versions 2.6.* will have two ports for each role. The metrics are available over the + /// UI port. + pub fn ports(&self, role: &HbaseRole, hbase_version: &str) -> Vec<(String, u16)> { + let result_without_metric_port: Vec<(String, u16)> = match role { + HbaseRole::Master => vec![ + ("master".to_string(), HBASE_MASTER_PORT), + (self.ui_port_name(), HBASE_MASTER_UI_PORT), + ], + HbaseRole::RegionServer => vec![ + ("regionserver".to_string(), HBASE_REGIONSERVER_PORT), + (self.ui_port_name(), HBASE_REGIONSERVER_UI_PORT), + ], + HbaseRole::RestServer => vec![ + ( + if self.has_https_enabled() { + HBASE_REST_PORT_NAME_HTTPS + } else { + HBASE_REST_PORT_NAME_HTTP + } + .to_string(), + HBASE_REST_PORT, + ), + (self.ui_port_name(), HBASE_REST_UI_PORT), + ], + }; + if hbase_version.starts_with(r"2.4") { + result_without_metric_port + .into_iter() + .chain(vec![(METRICS_PORT_NAME.to_string(), METRICS_PORT)]) + .collect() + } else { + result_without_metric_port + } + } + + /// Name of the port used by the Web UI, which depends on HTTPS usage + fn ui_port_name(&self) -> String { + if self.has_https_enabled() { + HBASE_UI_PORT_NAME_HTTPS + } else { + HBASE_UI_PORT_NAME_HTTP + } + .to_string() + } + + /// Retrieve and merge resource configs for role and role groups + pub fn merged_config( + &self, + role: &HbaseRole, + role_group: &str, + hdfs_discovery_cm_name: &str, + ) -> Result { + // Initialize the result with all default values as baseline + let conf_defaults = role.default_config(&self.name_any(), hdfs_discovery_cm_name); + + let role = self.get_role(role).context(MissingHbaseRoleSnafu { + role: role.to_string(), + })?; + + // Retrieve role resource config + let mut conf_role = role.config.config.to_owned(); + + // Retrieve rolegroup specific resource config + let mut conf_rolegroup = role + .role_groups + .get(role_group) + .map(|rg| rg.config.config.clone()) + .unwrap_or_default(); + + // Merge more specific configs into default config + // Hierarchy is: + // 1. RoleGroup + // 2. Role + // 3. Default + conf_role.merge(&conf_defaults); + conf_rolegroup.merge(&conf_role); + + tracing::debug!("Merged config: {:?}", conf_rolegroup); + fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) + } +} + #[derive(Snafu, Debug)] pub enum Error { #[snafu(display("the role [{role}] is invalid and does not exist in HBase"))] @@ -502,183 +679,6 @@ pub struct HbaseClusterStatus { pub conditions: Vec, } -impl HasStatusCondition for v1alpha1::HbaseCluster { - fn conditions(&self) -> Vec { - match &self.status { - Some(status) => status.conditions.clone(), - None => vec![], - } - } -} - -impl v1alpha1::HbaseCluster { - /// The name of the role-level load-balanced Kubernetes `Service` - pub fn server_role_service_name(&self) -> Option { - self.metadata.name.clone() - } - - /// Metadata about a server rolegroup - pub fn server_rolegroup_ref( - &self, - role_name: impl Into, - group_name: impl Into, - ) -> RoleGroupRef { - RoleGroupRef { - cluster: ObjectRef::from_obj(self), - role: role_name.into(), - role_group: group_name.into(), - } - } - - pub fn get_role( - &self, - role: &HbaseRole, - ) -> Option<&Role> { - match role { - HbaseRole::Master => self.spec.masters.as_ref(), - HbaseRole::RegionServer => self.spec.region_servers.as_ref(), - HbaseRole::RestServer => self.spec.rest_servers.as_ref(), - } - } - - /// Get the RoleGroup struct for the given ref - pub fn get_role_group( - &self, - rolegroup_ref: &RoleGroupRef, - ) -> Result<&RoleGroup, Error> { - let role_variant = - HbaseRole::from_str(&rolegroup_ref.role).with_context(|_| InvalidRoleSnafu { - role: rolegroup_ref.role.to_owned(), - })?; - let role = self - .get_role(&role_variant) - .with_context(|| MissingHbaseRoleSnafu { - role: role_variant.to_string(), - })?; - role.role_groups - .get(&rolegroup_ref.role_group) - .with_context(|| MissingHbaseRoleGroupSnafu { - role_group: rolegroup_ref.role_group.to_owned(), - }) - } - - pub fn role_config(&self, role: &HbaseRole) -> Option<&GenericRoleConfig> { - match role { - HbaseRole::Master => self.spec.masters.as_ref().map(|m| &m.role_config), - HbaseRole::RegionServer => self.spec.region_servers.as_ref().map(|rs| &rs.role_config), - HbaseRole::RestServer => self.spec.rest_servers.as_ref().map(|rs| &rs.role_config), - } - } - - pub fn has_kerberos_enabled(&self) -> bool { - self.kerberos_secret_class().is_some() - } - - pub fn kerberos_secret_class(&self) -> Option { - self.spec - .cluster_config - .authentication - .as_ref() - .map(|a| &a.kerberos) - .map(|k| k.secret_class.clone()) - } - - pub fn has_https_enabled(&self) -> bool { - self.https_secret_class().is_some() - } - - pub fn https_secret_class(&self) -> Option { - self.spec - .cluster_config - .authentication - .as_ref() - .map(|a| a.tls_secret_class.clone()) - } - - /// Returns required port name and port number tuples depending on the role. - /// Hbase versions 2.4.* will have three ports for each role - /// Hbase versions 2.6.* will have two ports for each role. The metrics are available over the - /// UI port. - pub fn ports(&self, role: &HbaseRole, hbase_version: &str) -> Vec<(String, u16)> { - let result_without_metric_port: Vec<(String, u16)> = match role { - HbaseRole::Master => vec![ - ("master".to_string(), HBASE_MASTER_PORT), - (self.ui_port_name(), HBASE_MASTER_UI_PORT), - ], - HbaseRole::RegionServer => vec![ - ("regionserver".to_string(), HBASE_REGIONSERVER_PORT), - (self.ui_port_name(), HBASE_REGIONSERVER_UI_PORT), - ], - HbaseRole::RestServer => vec![ - ( - if self.has_https_enabled() { - HBASE_REST_PORT_NAME_HTTPS - } else { - HBASE_REST_PORT_NAME_HTTP - } - .to_string(), - HBASE_REST_PORT, - ), - (self.ui_port_name(), HBASE_REST_UI_PORT), - ], - }; - if hbase_version.starts_with(r"2.4") { - result_without_metric_port - .into_iter() - .chain(vec![(METRICS_PORT_NAME.to_string(), METRICS_PORT)]) - .collect() - } else { - result_without_metric_port - } - } - - /// Name of the port used by the Web UI, which depends on HTTPS usage - fn ui_port_name(&self) -> String { - if self.has_https_enabled() { - HBASE_UI_PORT_NAME_HTTPS - } else { - HBASE_UI_PORT_NAME_HTTP - } - .to_string() - } - - /// Retrieve and merge resource configs for role and role groups - pub fn merged_config( - &self, - role: &HbaseRole, - role_group: &str, - hdfs_discovery_cm_name: &str, - ) -> Result { - // Initialize the result with all default values as baseline - let conf_defaults = role.default_config(&self.name_any(), hdfs_discovery_cm_name); - - let role = self.get_role(role).context(MissingHbaseRoleSnafu { - role: role.to_string(), - })?; - - // Retrieve role resource config - let mut conf_role = role.config.config.to_owned(); - - // Retrieve rolegroup specific resource config - let mut conf_rolegroup = role - .role_groups - .get(role_group) - .map(|rg| rg.config.config.clone()) - .unwrap_or_default(); - - // Merge more specific configs into default config - // Hierarchy is: - // 1. RoleGroup - // 2. Role - // 3. Default - conf_role.merge(&conf_defaults); - conf_rolegroup.merge(&conf_role); - - tracing::debug!("Merged config: {:?}", conf_rolegroup); - fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) - } -} - pub fn merged_env(rolegroup_config: Option<&BTreeMap>) -> Vec { let merged_env: Vec = if let Some(rolegroup_config) = rolegroup_config { let env_vars_from_config: BTreeMap = rolegroup_config From ea11d3e9e8ad22f0f16553d22415d96bb1efdd94 Mon Sep 17 00:00:00 2001 From: Techassi Date: Mon, 17 Feb 2025 10:54:45 +0100 Subject: [PATCH 7/7] chore: Apply suggestion Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- rust/operator-binary/src/hbase_controller.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 8fca286f..6bfdfab6 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -1,6 +1,5 @@ -//! Ensures that `Pod`s are configured and running for each [`HbaseCluster`][v1alpha1] -//! -//! [v1alpha1]: crate::crd::v1alpha1::HbaseCluster +//! Ensures that `Pod`s are configured and running for each [`v1alpha1::HbaseCluster`] + use std::{ collections::{BTreeMap, HashMap}, fmt::Write,