Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ 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

- BREAKING: Use `serde_json::Value` instead of `String` for user-provided JSON `configOverrides`. This change is marked as breaking, as it causes a breaking change to the CRDs ([#1206]).

[#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

Expand Down
5 changes: 3 additions & 2 deletions crates/stackable-operator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Comment thread
Techassi marked this conversation as resolved.

client-feature-gates = ["dep:winnow"]
crds = ["dep:stackable-versioned"]
certs = ["dep:stackable-certs"]
time = ["stackable-shared/time"]
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion crates/stackable-operator/src/client/feature_gates.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -14,7 +16,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<Vec<FeatureGate>> {
let request =
Expand Down
8 changes: 7 additions & 1 deletion crates/stackable-operator/src/client/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Provides additional functionality on top of [`kube::Client`].

use std::{
convert::TryFrom,
fmt::{Debug, Display},
Expand All @@ -24,7 +26,8 @@ use crate::{
utils::cluster_info::{KubernetesClusterInfo, KubernetesClusterInfoOptions},
};

mod feature_gates;
#[cfg(feature = "client-feature-gates")]
pub mod feature_gates;

pub type Result<T, E = Error> = std::result::Result<T, E>;

Expand Down Expand Up @@ -92,15 +95,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 },
}
Expand Down
Loading