Skip to content

Commit 0ab1fb1

Browse files
committed
feat(operator): Add client-feature-gates gate
1 parent d2e418b commit 0ab1fb1

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

crates/stackable-operator/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ repository.workspace = true
99

1010
[features]
1111
default = ["crds"]
12-
full = ["crds", "certs", "time", "webhook", "kube-ws"]
12+
full = ["client-feature-gates", "crds", "certs", "time", "webhook", "kube-ws"]
1313

14+
client-feature-gates = ["dep:winnow"]
1415
crds = ["dep:stackable-versioned"]
1516
certs = ["dep:stackable-certs"]
1617
time = ["stackable-shared/time"]
@@ -54,7 +55,7 @@ tracing.workspace = true
5455
tracing-appender.workspace = true
5556
tracing-subscriber.workspace = true
5657
url.workspace = true
57-
winnow.workspace = true
58+
winnow = { workspace = true, optional = true }
5859

5960
[dev-dependencies]
6061
indoc.workspace = true

crates/stackable-operator/src/client/feature_gates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::client::{
1414
impl Client {
1515
/// Retrieves and parses all feature gates via a raw request to the `/metrics` endpoint.
1616
///
17-
/// This list of feature gates in combination with [`KubeClient::apiserver_version`] can be used
17+
/// This list of feature gates in combination with [`kube::Client::apiserver_version`] can be used
1818
/// to enable gated behaviour.
1919
pub async fn get_feature_gates(&self) -> Result<Vec<FeatureGate>> {
2020
let request =

crates/stackable-operator/src/client/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ use crate::{
2424
utils::cluster_info::{KubernetesClusterInfo, KubernetesClusterInfoOptions},
2525
};
2626

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

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

@@ -92,15 +93,18 @@ pub enum Error {
9293
source: crate::utils::cluster_info::Error,
9394
},
9495

96+
#[cfg(feature = "client-feature-gates")]
9597
#[snafu(display("failed to create raw {method} request"))]
9698
CreateRawRequest {
9799
source: http::Error,
98100
method: http::Method,
99101
},
100102

103+
#[cfg(feature = "client-feature-gates")]
101104
#[snafu(display("failed to perform raw request"))]
102105
PerformRawRequest { source: kube::Error },
103106

107+
#[cfg(feature = "client-feature-gates")]
104108
#[snafu(display("failed to parse feature gate: {error}"))]
105109
ParseFeatureGate { error: String },
106110
}

0 commit comments

Comments
 (0)