From 0ab1fb1bac1f608ce71554f735a9e651adbe06bd Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 27 May 2026 12:19:50 +0200 Subject: [PATCH 1/3] feat(operator): Add client-feature-gates gate --- crates/stackable-operator/Cargo.toml | 5 +++-- crates/stackable-operator/src/client/feature_gates.rs | 2 +- crates/stackable-operator/src/client/mod.rs | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/stackable-operator/Cargo.toml b/crates/stackable-operator/Cargo.toml index 193285726..080f31425 100644 --- a/crates/stackable-operator/Cargo.toml +++ b/crates/stackable-operator/Cargo.toml @@ -9,8 +9,9 @@ repository.workspace = true [features] default = ["crds"] -full = ["crds", "certs", "time", "webhook", "kube-ws"] +full = ["client-feature-gates", "crds", "certs", "time", "webhook", "kube-ws"] +client-feature-gates = ["dep:winnow"] crds = ["dep:stackable-versioned"] certs = ["dep:stackable-certs"] time = ["stackable-shared/time"] @@ -54,7 +55,7 @@ tracing.workspace = true tracing-appender.workspace = true tracing-subscriber.workspace = true url.workspace = true -winnow.workspace = true +winnow = { workspace = true, optional = true } [dev-dependencies] indoc.workspace = true diff --git a/crates/stackable-operator/src/client/feature_gates.rs b/crates/stackable-operator/src/client/feature_gates.rs index 4f49c782c..94e66f0dc 100644 --- a/crates/stackable-operator/src/client/feature_gates.rs +++ b/crates/stackable-operator/src/client/feature_gates.rs @@ -14,7 +14,7 @@ use crate::client::{ impl Client { /// Retrieves and parses all feature gates via a raw request to the `/metrics` endpoint. /// - /// This list of feature gates in combination with [`KubeClient::apiserver_version`] can be used + /// This list of feature gates in combination with [`kube::Client::apiserver_version`] can be used /// to enable gated behaviour. pub async fn get_feature_gates(&self) -> Result> { let request = diff --git a/crates/stackable-operator/src/client/mod.rs b/crates/stackable-operator/src/client/mod.rs index 11f2fbfc3..27969afd4 100644 --- a/crates/stackable-operator/src/client/mod.rs +++ b/crates/stackable-operator/src/client/mod.rs @@ -24,7 +24,8 @@ use crate::{ utils::cluster_info::{KubernetesClusterInfo, KubernetesClusterInfoOptions}, }; -mod feature_gates; +#[cfg(feature = "client-feature-gates")] +pub mod feature_gates; pub type Result = std::result::Result; @@ -92,15 +93,18 @@ pub enum Error { source: crate::utils::cluster_info::Error, }, + #[cfg(feature = "client-feature-gates")] #[snafu(display("failed to create raw {method} request"))] CreateRawRequest { source: http::Error, method: http::Method, }, + #[cfg(feature = "client-feature-gates")] #[snafu(display("failed to perform raw request"))] PerformRawRequest { source: kube::Error }, + #[cfg(feature = "client-feature-gates")] #[snafu(display("failed to parse feature gate: {error}"))] ParseFeatureGate { error: String }, } From 091150391cfa07902ced523eb3be9fa9753611dc Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 27 May 2026 13:00:20 +0200 Subject: [PATCH 2/3] docs(operator): Add module docs --- crates/stackable-operator/src/client/feature_gates.rs | 2 ++ crates/stackable-operator/src/client/mod.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/stackable-operator/src/client/feature_gates.rs b/crates/stackable-operator/src/client/feature_gates.rs index 94e66f0dc..8b2473b76 100644 --- a/crates/stackable-operator/src/client/feature_gates.rs +++ b/crates/stackable-operator/src/client/feature_gates.rs @@ -1,3 +1,5 @@ +//! Provides functions and types to retrieve feature gates from the Kubernetes apiserver. + use std::{collections::HashMap, str::FromStr}; use snafu::{OptionExt as _, ResultExt as _, Snafu}; diff --git a/crates/stackable-operator/src/client/mod.rs b/crates/stackable-operator/src/client/mod.rs index 27969afd4..57fce5195 100644 --- a/crates/stackable-operator/src/client/mod.rs +++ b/crates/stackable-operator/src/client/mod.rs @@ -1,3 +1,5 @@ +//! Provides additional functionality on top of [`kube::Client`]. + use std::{ convert::TryFrom, fmt::{Debug, Display}, From 9ccb278b58bd23d3980fbf896fd6c67fd212c249 Mon Sep 17 00:00:00 2001 From: Techassi Date: Wed, 27 May 2026 13:54:21 +0200 Subject: [PATCH 3/3] chore(operator): Add changelog entry --- crates/stackable-operator/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 04a6b4fc7..d6716a429 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Add `Client::{get_feature_gates,get_enabled_feature_gates,get_disabled_feature_gates}` associated - functions to retrieve all, enabled, or disabled feature gates from the Kubernetes apiserver ([#1207]). + functions to retrieve all, enabled, or disabled feature gates from the Kubernetes apiserver ([#1207], [#1208]). ### Changed @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. [#1206]: https://github.com/stackabletech/operator-rs/pull/1206 [#1207]: https://github.com/stackabletech/operator-rs/pull/1207 +[#1208]: https://github.com/stackabletech/operator-rs/pull/1208 ## [0.111.1] - 2026-04-28