From dd593a89207b5a2bca57b1fcf418fb777abc8f26 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 23 Oct 2025 13:09:08 +0200 Subject: [PATCH 01/14] feat: Support configuring listner-operator preset (with sensible defaults) --- Cargo.lock | 1 + rust/stackable-cockpit/Cargo.toml | 1 + .../platform/operator/listener_operator.rs | 106 ++++++++++++++++++ .../src/platform/operator/mod.rs | 21 +++- rust/stackablectl/CHANGELOG.md | 7 ++ rust/stackablectl/src/args/mod.rs | 2 + .../stackablectl/src/args/operator_configs.rs | 15 +++ rust/stackablectl/src/cli/mod.rs | 14 ++- 8 files changed, 160 insertions(+), 7 deletions(-) create mode 100644 rust/stackable-cockpit/src/platform/operator/listener_operator.rs create mode 100644 rust/stackablectl/src/args/operator_configs.rs diff --git a/Cargo.lock b/Cargo.lock index 8bc558c3..b991f326 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3438,6 +3438,7 @@ name = "stackable-cockpit" version = "0.0.0-dev" dependencies = [ "bcrypt", + "clap", "futures", "helm-sys", "indexmap 2.11.4", diff --git a/rust/stackable-cockpit/Cargo.toml b/rust/stackable-cockpit/Cargo.toml index 1decc06f..dcd0c3eb 100644 --- a/rust/stackable-cockpit/Cargo.toml +++ b/rust/stackable-cockpit/Cargo.toml @@ -16,6 +16,7 @@ openapi = ["dep:utoipa"] helm-sys = { path = "../helm-sys" } bcrypt.workspace = true +clap.workspace = true indexmap.workspace = true k8s-openapi.workspace = true kube.workspace = true diff --git a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs new file mode 100644 index 00000000..b5ec7d03 --- /dev/null +++ b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs @@ -0,0 +1,106 @@ +use clap::ValueEnum; +use snafu::ResultExt; +use stackable_operator::{ + k8s_openapi::api::core::v1::Node, + kube::{Api, Client, api::ListParams}, +}; +use tokio::sync::OnceCell; +use tracing::{debug, info, instrument}; + +pub static LISTENER_OPERATOR_PRESET: OnceCell = OnceCell::const_new(); + +#[derive(Copy, Clone, Debug, ValueEnum)] +pub enum ListenerOperatorPreset { + None, + StableNodes, + EphemeralNodes, +} + +impl ListenerOperatorPreset { + pub fn as_helm_values(&self) -> String { + let preset_value = match self { + Self::None => "none", + Self::StableNodes => "stable-nodes", + Self::EphemeralNodes => "ephemeral-nodes", + }; + format!("preset: {preset_value}") + } +} + +#[instrument] +pub async fn determine_and_store_listener_operator_preset( + from_cli: Option<&ListenerOperatorPreset>, +) { + if let Some(from_cli) = from_cli { + LISTENER_OPERATOR_PRESET + .set(*from_cli) + .expect("We are the only function setting LISTENER_OPERATOR_PRESET"); + return; + } + + let kubernetes_environment = guess_kubernetes_environment().await.unwrap_or_else(|err| { + info!("failed to determine Kubernetes environment, using defaults: {err:#?}"); + KubernetesEnvironment::Unknown + }); + let listener_operator_preset = match kubernetes_environment { + // Kind does not support LoadBalancers out of the box, so avoid that + KubernetesEnvironment::Kind => ListenerOperatorPreset::StableNodes, + // LoadBalancer support in k3s is optional, so let's be better safe than sorry and not use + // them + KubernetesEnvironment::K3s => ListenerOperatorPreset::StableNodes, + // Weekly node rotations and LoadBalancer support + KubernetesEnvironment::Ionos => ListenerOperatorPreset::EphemeralNodes, + // Don't pin nodes and assume we have LoadBalancer support + KubernetesEnvironment::Unknown => ListenerOperatorPreset::EphemeralNodes, + }; + debug!( + preset = ?listener_operator_preset, + kubernetes.environment = ?kubernetes_environment, + "Using listener-operator preset" + ); + + LISTENER_OPERATOR_PRESET + .set(listener_operator_preset) + .expect("We are the only function setting LISTENER_OPERATOR_PRESET"); +} + +#[derive(Debug)] +enum KubernetesEnvironment { + Kind, + K3s, + Ionos, + Unknown, +} + +/// Tries to guess what Kubernetes environment stackablectl is connecting to. +/// +/// Returns an `Err(())` in case anything goes wrong. This could e.g. be the case in case no +/// Kubernetes context is configured, stackablectl is missing RBAC permission to retrieve nodes or +/// simply a network error, +#[instrument] +async fn guess_kubernetes_environment() -> Result { + let client = Client::try_default() + .await + .whatever_context("failed to construct Kubernetes client")?; + let node_api: Api = Api::all(client); + let nodes = node_api + .list(&ListParams::default()) + .await + .whatever_context("failed to list Kubernetes nodes")?; + + for node in nodes { + if let Some(spec) = node.spec { + if let Some(provider_id) = spec.provider_id { + if provider_id.starts_with("kind://") { + return Ok(KubernetesEnvironment::Kind); + } else if provider_id.starts_with("k3s://") { + return Ok(KubernetesEnvironment::K3s); + } else if provider_id.starts_with("ionos://") { + return Ok(KubernetesEnvironment::Ionos); + } + } + } + } + + Ok(KubernetesEnvironment::Unknown) +} diff --git a/rust/stackable-cockpit/src/platform/operator/mod.rs b/rust/stackable-cockpit/src/platform/operator/mod.rs index 540616ed..12598f30 100644 --- a/rust/stackable-cockpit/src/platform/operator/mod.rs +++ b/rust/stackable-cockpit/src/platform/operator/mod.rs @@ -1,5 +1,6 @@ use std::{fmt::Display, str::FromStr}; +use listener_operator::LISTENER_OPERATOR_PRESET; use semver::Version; use serde::Serialize; use snafu::{ResultExt, Snafu, ensure}; @@ -14,6 +15,8 @@ use crate::{ utils::operator_chart_name, }; +pub mod listener_operator; + pub const VALID_OPERATORS: &[&str] = &[ "airflow", "commons", @@ -93,10 +96,9 @@ impl FromStr for OperatorSpec { ensure!(len <= 2, InvalidEqualSignCountSnafu); // Check if the provided operator name is in the list of valid operators - ensure!( - VALID_OPERATORS.contains(&parts[0]), - InvalidNameSnafu { name: parts[0] } - ); + ensure!(VALID_OPERATORS.contains(&parts[0]), InvalidNameSnafu { + name: parts[0] + }); // If there is only one part, the input didn't include // the optional version identifier @@ -208,6 +210,15 @@ impl OperatorSpec { ChartSourceType::Repo => self.helm_repo_name(), }; + let mut helm_values = None; + if self.name == "listener" { + helm_values = Some( + LISTENER_OPERATOR_PRESET.get() + .expect("At this point LISTENER_OPERATOR_PRESET must be set by determine_and_store_listener_operator_preset") + .as_helm_values() + ); + }; + // Install using Helm helm::install_release_from_repo_or_registry( &helm_name, @@ -216,7 +227,7 @@ impl OperatorSpec { chart_name: &helm_name, chart_source: &chart_source, }, - None, + helm_values.as_deref(), namespace, true, )?; diff --git a/rust/stackablectl/CHANGELOG.md b/rust/stackablectl/CHANGELOG.md index 356d88a8..a2794d6d 100644 --- a/rust/stackablectl/CHANGELOG.md +++ b/rust/stackablectl/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#XXX]). +- Support configuring the [listener-operator preset] using `--listener-operator-preset` ([#XXX]). + +[listener-operator preset]: https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets + ## [1.1.0] - 2025-07-16 ### Added diff --git a/rust/stackablectl/src/args/mod.rs b/rust/stackablectl/src/args/mod.rs index e6467ff8..cb31577f 100644 --- a/rust/stackablectl/src/args/mod.rs +++ b/rust/stackablectl/src/args/mod.rs @@ -1,9 +1,11 @@ mod cluster; mod file; mod namespace; +mod operator_configs; mod repo; pub use cluster::*; pub use file::*; pub use namespace::*; +pub use operator_configs::*; pub use repo::*; diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs new file mode 100644 index 00000000..a93e44ec --- /dev/null +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -0,0 +1,15 @@ +use clap::Args; +use stackable_cockpit::platform::operator::listener_operator::ListenerOperatorPreset; + +#[derive(Debug, Args)] +#[command(next_help_heading = "Operator specific configurations")] +pub struct CommonOperatorConfigsArgs { + /// Choose the listener-operator preset (`none`, `ephemeral-nodes` or `stable-nodes`). + /// + /// See [the listener-operator documentation](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets) + /// for details. + /// + /// This argument is temporary until we support setting arbitrary helm values for the operators! + #[arg(long, global = true)] + pub listener_operator_preset: Option, +} diff --git a/rust/stackablectl/src/cli/mod.rs b/rust/stackablectl/src/cli/mod.rs index a5a3d53f..bd2768c5 100644 --- a/rust/stackablectl/src/cli/mod.rs +++ b/rust/stackablectl/src/cli/mod.rs @@ -6,7 +6,9 @@ use snafu::{ResultExt, Snafu}; use stackable_cockpit::{ constants::{HELM_REPO_NAME_DEV, HELM_REPO_NAME_STABLE, HELM_REPO_NAME_TEST}, helm, - platform::operator::ChartSourceType, + platform::operator::{ + ChartSourceType, listener_operator::determine_and_store_listener_operator_preset, + }, utils::path::{ IntoPathOrUrl, IntoPathsOrUrls, ParsePathsOrUrls, PathOrUrl, PathOrUrlParseError, }, @@ -15,7 +17,7 @@ use stackable_cockpit::{ use tracing::{Level, instrument}; use crate::{ - args::{CommonFileArgs, CommonRepoArgs}, + args::{CommonFileArgs, CommonOperatorConfigsArgs, CommonRepoArgs}, cmds::{cache, completions, debug, demo, operator, release, stack, stacklet}, constants::{ DEMOS_REPOSITORY_DEMOS_SUBPATH, DEMOS_REPOSITORY_STACKS_SUBPATH, DEMOS_REPOSITORY_URL_BASE, @@ -79,6 +81,9 @@ Cached files are saved at '$XDG_CACHE_HOME/stackablectl', which is usually #[command(flatten)] pub repos: CommonRepoArgs, + #[command(flatten)] + pub operator_configs: CommonOperatorConfigsArgs, + #[command(subcommand)] pub subcommand: Commands, } @@ -186,6 +191,11 @@ impl Cli { // TODO (Techassi): Do we still want to auto purge when running cache commands? cache.auto_purge().await.unwrap(); + determine_and_store_listener_operator_preset( + self.operator_configs.listener_operator_preset.as_ref(), + ) + .await; + match &self.subcommand { Commands::Operator(args) => args.run(self).await.context(OperatorSnafu), Commands::Release(args) => args.run(self, cache).await.context(ReleaseSnafu), From 49039e35c8d5b2d2fd983f78ef9d83ff1cebe6a0 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 23 Oct 2025 13:16:32 +0200 Subject: [PATCH 02/14] Update rustdoc --- .../src/platform/operator/listener_operator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs index b5ec7d03..acf58362 100644 --- a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs +++ b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs @@ -74,9 +74,9 @@ enum KubernetesEnvironment { /// Tries to guess what Kubernetes environment stackablectl is connecting to. /// -/// Returns an `Err(())` in case anything goes wrong. This could e.g. be the case in case no +/// Returns an error in case anything goes wrong. This could e.g. be the case in case no /// Kubernetes context is configured, stackablectl is missing RBAC permission to retrieve nodes or -/// simply a network error, +/// simply a network error. #[instrument] async fn guess_kubernetes_environment() -> Result { let client = Client::try_default() From 2d96b646e1f10596bfc8103d23539ed6f61f2649 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Thu, 23 Oct 2025 13:31:03 +0200 Subject: [PATCH 03/14] changelog --- rust/stackablectl/CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/stackablectl/CHANGELOG.md b/rust/stackablectl/CHANGELOG.md index a2794d6d..f0e1c87f 100644 --- a/rust/stackablectl/CHANGELOG.md +++ b/rust/stackablectl/CHANGELOG.md @@ -6,9 +6,10 @@ All notable changes to this project will be documented in this file. ### Added -- Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#XXX]). -- Support configuring the [listener-operator preset] using `--listener-operator-preset` ([#XXX]). +- Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#414]). +- Support configuring the [listener-operator preset] using `--listener-operator-preset` ([#414]). +[#414]: https://github.com/stackabletech/stackable-cockpit/pull/414 [listener-operator preset]: https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets ## [1.1.0] - 2025-07-16 From a8db362849e7d06d4cf8a1f0246735117a86230d Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 10:31:40 +0200 Subject: [PATCH 04/14] --listener-operator-preset -> --listener-class-presets --- rust/stackablectl/CHANGELOG.md | 2 +- rust/stackablectl/src/args/operator_configs.rs | 10 ++++++---- rust/stackablectl/src/cli/mod.rs | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/rust/stackablectl/CHANGELOG.md b/rust/stackablectl/CHANGELOG.md index f0e1c87f..14e837b8 100644 --- a/rust/stackablectl/CHANGELOG.md +++ b/rust/stackablectl/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#414]). -- Support configuring the [listener-operator preset] using `--listener-operator-preset` ([#414]). +- Support configuring the [listener-operator preset] using `--listener-class-presets` ([#414]). [#414]: https://github.com/stackabletech/stackable-cockpit/pull/414 [listener-operator preset]: https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs index a93e44ec..13a5afa8 100644 --- a/rust/stackablectl/src/args/operator_configs.rs +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -4,12 +4,14 @@ use stackable_cockpit::platform::operator::listener_operator::ListenerOperatorPr #[derive(Debug, Args)] #[command(next_help_heading = "Operator specific configurations")] pub struct CommonOperatorConfigsArgs { - /// Choose the listener-operator preset (`none`, `ephemeral-nodes` or `stable-nodes`). + /// Choose the ListenerClass presets (`none`, `ephemeral-nodes` or `stable-nodes`). /// - /// See [the listener-operator documentation](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets) + /// This maps to the listener-operator preset, see + /// [the listener-operator documentation](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets) /// for details. /// - /// This argument is temporary until we support setting arbitrary helm values for the operators! + /// This argument is likely temporary until we support setting arbitrary helm values for the + /// operators! #[arg(long, global = true)] - pub listener_operator_preset: Option, + pub listener_class_presets: Option, } diff --git a/rust/stackablectl/src/cli/mod.rs b/rust/stackablectl/src/cli/mod.rs index bd2768c5..c8b72305 100644 --- a/rust/stackablectl/src/cli/mod.rs +++ b/rust/stackablectl/src/cli/mod.rs @@ -192,7 +192,7 @@ impl Cli { cache.auto_purge().await.unwrap(); determine_and_store_listener_operator_preset( - self.operator_configs.listener_operator_preset.as_ref(), + self.operator_configs.listener_class_presets.as_ref(), ) .await; From ca2895b2b5aa9c55a55fcb7d3b3c917c4e4f0ae4 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:35:51 +0200 Subject: [PATCH 05/14] Update rust/stackable-cockpit/src/platform/operator/listener_operator.rs Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- .../src/platform/operator/listener_operator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs index acf58362..00c7ad80 100644 --- a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs +++ b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs @@ -61,7 +61,7 @@ pub async fn determine_and_store_listener_operator_preset( LISTENER_OPERATOR_PRESET .set(listener_operator_preset) - .expect("We are the only function setting LISTENER_OPERATOR_PRESET"); + .expect("LISTENER_CLASS_PRESET should be unset"); } #[derive(Debug)] From 263b9cd3d521e587fbf79477021d814ef795e5fd Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:37:00 +0200 Subject: [PATCH 06/14] Apply suggestions from code review Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- .../platform/operator/listener_operator.rs | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs index 00c7ad80..74744599 100644 --- a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs +++ b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs @@ -7,10 +7,11 @@ use stackable_operator::{ use tokio::sync::OnceCell; use tracing::{debug, info, instrument}; -pub static LISTENER_OPERATOR_PRESET: OnceCell = OnceCell::const_new(); +pub static LISTENER_CLASS_PRESET: OnceCell = OnceCell::const_new(); +/// Represents the `preset` value in the Listener Operator Helm Chart #[derive(Copy, Clone, Debug, ValueEnum)] -pub enum ListenerOperatorPreset { +pub enum ListenerClassPreset { None, StableNodes, EphemeralNodes, @@ -28,13 +29,13 @@ impl ListenerOperatorPreset { } #[instrument] -pub async fn determine_and_store_listener_operator_preset( - from_cli: Option<&ListenerOperatorPreset>, +pub async fn determine_and_store_listener_class_preset( + from_cli: Option<&ListenerClassPreset>, ) { if let Some(from_cli) = from_cli { - LISTENER_OPERATOR_PRESET + LISTENER_CLASS_PRESET .set(*from_cli) - .expect("We are the only function setting LISTENER_OPERATOR_PRESET"); + .expect("LISTENER_CLASS_PRESET should be unset"); return; } @@ -42,25 +43,25 @@ pub async fn determine_and_store_listener_operator_preset( info!("failed to determine Kubernetes environment, using defaults: {err:#?}"); KubernetesEnvironment::Unknown }); - let listener_operator_preset = match kubernetes_environment { + let listener_class_preset = match kubernetes_environment { // Kind does not support LoadBalancers out of the box, so avoid that - KubernetesEnvironment::Kind => ListenerOperatorPreset::StableNodes, + KubernetesEnvironment::Kind => ListenerClassPreset::StableNodes, // LoadBalancer support in k3s is optional, so let's be better safe than sorry and not use // them - KubernetesEnvironment::K3s => ListenerOperatorPreset::StableNodes, + KubernetesEnvironment::K3s => ListenerClassPreset::StableNodes, // Weekly node rotations and LoadBalancer support - KubernetesEnvironment::Ionos => ListenerOperatorPreset::EphemeralNodes, + KubernetesEnvironment::Ionos => ListenerClassPreset::EphemeralNodes, // Don't pin nodes and assume we have LoadBalancer support - KubernetesEnvironment::Unknown => ListenerOperatorPreset::EphemeralNodes, + KubernetesEnvironment::Unknown => ListenerClassPreset::EphemeralNodes, }; debug!( - preset = ?listener_operator_preset, + preset = ?listener_class_preset, kubernetes.environment = ?kubernetes_environment, - "Using listener-operator preset" + "Using ListenerClass preset" ); - LISTENER_OPERATOR_PRESET - .set(listener_operator_preset) + LISTENER_CLASS_PRESET + .set(listener_class_preset) .expect("LISTENER_CLASS_PRESET should be unset"); } From 3e69cd9835aa7371d9b99e6e46bb8934aadac99d Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:41:51 +0200 Subject: [PATCH 07/14] Fix compilation --- .../src/platform/operator/listener_operator.rs | 6 ++---- rust/stackable-cockpit/src/platform/operator/mod.rs | 4 ++-- rust/stackablectl/src/args/operator_configs.rs | 4 ++-- rust/stackablectl/src/cli/mod.rs | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs index 74744599..81cec862 100644 --- a/rust/stackable-cockpit/src/platform/operator/listener_operator.rs +++ b/rust/stackable-cockpit/src/platform/operator/listener_operator.rs @@ -17,7 +17,7 @@ pub enum ListenerClassPreset { EphemeralNodes, } -impl ListenerOperatorPreset { +impl ListenerClassPreset { pub fn as_helm_values(&self) -> String { let preset_value = match self { Self::None => "none", @@ -29,9 +29,7 @@ impl ListenerOperatorPreset { } #[instrument] -pub async fn determine_and_store_listener_class_preset( - from_cli: Option<&ListenerClassPreset>, -) { +pub async fn determine_and_store_listener_class_preset(from_cli: Option<&ListenerClassPreset>) { if let Some(from_cli) = from_cli { LISTENER_CLASS_PRESET .set(*from_cli) diff --git a/rust/stackable-cockpit/src/platform/operator/mod.rs b/rust/stackable-cockpit/src/platform/operator/mod.rs index 12598f30..6177b436 100644 --- a/rust/stackable-cockpit/src/platform/operator/mod.rs +++ b/rust/stackable-cockpit/src/platform/operator/mod.rs @@ -1,6 +1,6 @@ use std::{fmt::Display, str::FromStr}; -use listener_operator::LISTENER_OPERATOR_PRESET; +use listener_operator::LISTENER_CLASS_PRESET; use semver::Version; use serde::Serialize; use snafu::{ResultExt, Snafu, ensure}; @@ -213,7 +213,7 @@ impl OperatorSpec { let mut helm_values = None; if self.name == "listener" { helm_values = Some( - LISTENER_OPERATOR_PRESET.get() + LISTENER_CLASS_PRESET.get() .expect("At this point LISTENER_OPERATOR_PRESET must be set by determine_and_store_listener_operator_preset") .as_helm_values() ); diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs index 13a5afa8..da6b8ffc 100644 --- a/rust/stackablectl/src/args/operator_configs.rs +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -1,5 +1,5 @@ use clap::Args; -use stackable_cockpit::platform::operator::listener_operator::ListenerOperatorPreset; +use stackable_cockpit::platform::operator::listener_operator::ListenerClassPreset; #[derive(Debug, Args)] #[command(next_help_heading = "Operator specific configurations")] @@ -13,5 +13,5 @@ pub struct CommonOperatorConfigsArgs { /// This argument is likely temporary until we support setting arbitrary helm values for the /// operators! #[arg(long, global = true)] - pub listener_class_presets: Option, + pub listener_class_presets: Option, } diff --git a/rust/stackablectl/src/cli/mod.rs b/rust/stackablectl/src/cli/mod.rs index c8b72305..995cb567 100644 --- a/rust/stackablectl/src/cli/mod.rs +++ b/rust/stackablectl/src/cli/mod.rs @@ -7,7 +7,7 @@ use stackable_cockpit::{ constants::{HELM_REPO_NAME_DEV, HELM_REPO_NAME_STABLE, HELM_REPO_NAME_TEST}, helm, platform::operator::{ - ChartSourceType, listener_operator::determine_and_store_listener_operator_preset, + ChartSourceType, listener_operator::determine_and_store_listener_class_preset, }, utils::path::{ IntoPathOrUrl, IntoPathsOrUrls, ParsePathsOrUrls, PathOrUrl, PathOrUrlParseError, @@ -191,7 +191,7 @@ impl Cli { // TODO (Techassi): Do we still want to auto purge when running cache commands? cache.auto_purge().await.unwrap(); - determine_and_store_listener_operator_preset( + determine_and_store_listener_class_preset( self.operator_configs.listener_class_presets.as_ref(), ) .await; From be8fade089448a71a99f048a95e82f10944571e5 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:42:52 +0200 Subject: [PATCH 08/14] Make CLI flag --listener-class-preset singular --- rust/stackablectl/CHANGELOG.md | 2 +- rust/stackablectl/src/args/operator_configs.rs | 2 +- rust/stackablectl/src/cli/mod.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/stackablectl/CHANGELOG.md b/rust/stackablectl/CHANGELOG.md index 14e837b8..b2189444 100644 --- a/rust/stackablectl/CHANGELOG.md +++ b/rust/stackablectl/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#414]). -- Support configuring the [listener-operator preset] using `--listener-class-presets` ([#414]). +- Support configuring the [listener-operator preset] using `--listener-class-preset` ([#414]). [#414]: https://github.com/stackabletech/stackable-cockpit/pull/414 [listener-operator preset]: https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs index da6b8ffc..56e995f4 100644 --- a/rust/stackablectl/src/args/operator_configs.rs +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -13,5 +13,5 @@ pub struct CommonOperatorConfigsArgs { /// This argument is likely temporary until we support setting arbitrary helm values for the /// operators! #[arg(long, global = true)] - pub listener_class_presets: Option, + pub listener_class_preset: Option, } diff --git a/rust/stackablectl/src/cli/mod.rs b/rust/stackablectl/src/cli/mod.rs index 995cb567..bad3bdd8 100644 --- a/rust/stackablectl/src/cli/mod.rs +++ b/rust/stackablectl/src/cli/mod.rs @@ -192,7 +192,7 @@ impl Cli { cache.auto_purge().await.unwrap(); determine_and_store_listener_class_preset( - self.operator_configs.listener_class_presets.as_ref(), + self.operator_configs.listener_class_preset.as_ref(), ) .await; From 3281de14090dedd73d2e2f9f109588b1ef139255 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:43:48 +0200 Subject: [PATCH 09/14] Update CLI docs --- rust/stackablectl/src/args/operator_configs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs index 56e995f4..4b2d0afd 100644 --- a/rust/stackablectl/src/args/operator_configs.rs +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -4,7 +4,7 @@ use stackable_cockpit::platform::operator::listener_operator::ListenerClassPrese #[derive(Debug, Args)] #[command(next_help_heading = "Operator specific configurations")] pub struct CommonOperatorConfigsArgs { - /// Choose the ListenerClass presets (`none`, `ephemeral-nodes` or `stable-nodes`). + /// Choose the ListenerClass preset (`none`, `ephemeral-nodes` or `stable-nodes`). /// /// This maps to the listener-operator preset, see /// [the listener-operator documentation](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets) From 3ff1776c81f6a6296935773173309fefbd77a70e Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:47:08 +0200 Subject: [PATCH 10/14] change link title in changelog --- rust/stackablectl/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/stackablectl/CHANGELOG.md b/rust/stackablectl/CHANGELOG.md index b2189444..86f42d6e 100644 --- a/rust/stackablectl/CHANGELOG.md +++ b/rust/stackablectl/CHANGELOG.md @@ -7,10 +7,10 @@ All notable changes to this project will be documented in this file. ### Added - Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#414]). -- Support configuring the [listener-operator preset] using `--listener-class-preset` ([#414]). +- Support configuring the [ListenerClass preset] using `--listener-class-preset` ([#414]). [#414]: https://github.com/stackabletech/stackable-cockpit/pull/414 -[listener-operator preset]: https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets +[ListenerClass preset]: https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets ## [1.1.0] - 2025-07-16 From fd044d2f43541529e1dc7d6f3ac0105548b44141 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:47:39 +0200 Subject: [PATCH 11/14] Update rust/stackablectl/src/args/operator_configs.rs Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- rust/stackablectl/src/args/operator_configs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs index 4b2d0afd..c9d1bbea 100644 --- a/rust/stackablectl/src/args/operator_configs.rs +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -6,7 +6,7 @@ use stackable_cockpit::platform::operator::listener_operator::ListenerClassPrese pub struct CommonOperatorConfigsArgs { /// Choose the ListenerClass preset (`none`, `ephemeral-nodes` or `stable-nodes`). /// - /// This maps to the listener-operator preset, see + /// This maps to the listener-operator Helm Chart preset value, see /// [the listener-operator documentation](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets) /// for details. /// From 3019ae3bba967094bcd5a35c5b8c3d8f8443d78e Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Fri, 24 Oct 2025 13:48:01 +0200 Subject: [PATCH 12/14] Remove docs on temporary --- rust/stackablectl/src/args/operator_configs.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/rust/stackablectl/src/args/operator_configs.rs b/rust/stackablectl/src/args/operator_configs.rs index c9d1bbea..f0bbbef4 100644 --- a/rust/stackablectl/src/args/operator_configs.rs +++ b/rust/stackablectl/src/args/operator_configs.rs @@ -9,9 +9,6 @@ pub struct CommonOperatorConfigsArgs { /// This maps to the listener-operator Helm Chart preset value, see /// [the listener-operator documentation](https://docs.stackable.tech/home/nightly/listener-operator/listenerclass/#presets) /// for details. - /// - /// This argument is likely temporary until we support setting arbitrary helm values for the - /// operators! #[arg(long, global = true)] pub listener_class_preset: Option, } From 8d838f08c64e2f8bd9f8be34c8fe707b226da1ed Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Tue, 28 Oct 2025 13:55:05 +0100 Subject: [PATCH 13/14] Update rust/stackable-cockpit/src/platform/operator/mod.rs Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- rust/stackable-cockpit/src/platform/operator/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/stackable-cockpit/src/platform/operator/mod.rs b/rust/stackable-cockpit/src/platform/operator/mod.rs index 6177b436..1e7dc64b 100644 --- a/rust/stackable-cockpit/src/platform/operator/mod.rs +++ b/rust/stackable-cockpit/src/platform/operator/mod.rs @@ -214,7 +214,7 @@ impl OperatorSpec { if self.name == "listener" { helm_values = Some( LISTENER_CLASS_PRESET.get() - .expect("At this point LISTENER_OPERATOR_PRESET must be set by determine_and_store_listener_operator_preset") + .expect("At this point LISTENER_CLASS_PRESET must be set by determine_and_store_listener_class_preset") .as_helm_values() ); }; From bfa6b257f6caa0037a521d85dd561a645b15f7a3 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Tue, 28 Oct 2025 13:55:14 +0100 Subject: [PATCH 14/14] Update rust/stackablectl/CHANGELOG.md Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com> --- rust/stackablectl/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/stackablectl/CHANGELOG.md b/rust/stackablectl/CHANGELOG.md index 86f42d6e..d095589c 100644 --- a/rust/stackablectl/CHANGELOG.md +++ b/rust/stackablectl/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file. ### Added -- Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [listener-operator preset] by default ([#414]). +- Automatically detect Kubernetes environment (e.g. kind, k3s or IONOS) and choose a sensible [ListenerClass preset] by default ([#414]). - Support configuring the [ListenerClass preset] using `--listener-class-preset` ([#414]). [#414]: https://github.com/stackabletech/stackable-cockpit/pull/414