Skip to content

Commit ee44001

Browse files
committed
refactor!(stackable-operator): Gate KubernetesClusterInfoOptions' clap integration
1 parent 03f9f59 commit ee44001

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

crates/stackable-operator/Cargo.toml

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

1010
[features]
11-
full = ["certs", "telemetry", "versioned", "time", "webhook"]
12-
default = ["telemetry", "versioned"]
11+
full = ["certs", "telemetry", "versioned", "time", "webhook", "clap"]
12+
default = ["telemetry", "versioned", "clap"]
1313

14+
clap = []
1415
certs = ["dep:stackable-certs"]
1516
telemetry = ["dep:stackable-telemetry"]
1617
time = ["stackable-shared/time"]

crates/stackable-operator/src/utils/cluster_info.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,24 @@ pub struct KubernetesClusterInfo {
1515
pub cluster_domain: DomainName,
1616
}
1717

18-
#[derive(clap::Parser, Debug, PartialEq, Eq)]
18+
#[cfg_attr(
19+
feature = "clap",
20+
derive(clap::Parser),
21+
command(next_help_heading = "Cluster Options")
22+
)]
23+
#[derive(Debug, PartialEq, Eq)]
1924
pub struct KubernetesClusterInfoOptions {
2025
/// Kubernetes cluster domain, usually this is `cluster.local`.
2126
// We are not using a default value here, as we query the cluster if it is not specified.
22-
#[arg(long, env)]
27+
#[cfg_attr(feature = "clap", arg(long, env))]
2328
pub kubernetes_cluster_domain: Option<DomainName>,
2429

2530
/// Name of the Kubernetes Node that the operator is running on.
2631
///
2732
/// Note that when running the operator on Kubernetes we recommend to use the
2833
/// [downward API](https://kubernetes.io/docs/concepts/workloads/pods/downward-api/)
2934
/// to let Kubernetes project the namespace as the `KUBERNETES_NODE_NAME` env variable.
30-
#[arg(long, env)]
35+
#[cfg_attr(feature = "clap", arg(long, env))]
3136
pub kubernetes_node_name: String,
3237
}
3338

crates/stackable-telemetry/src/tracing/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,11 @@ struct Cli {
786786
```
787787
"#
788788
)]
789-
#[cfg_attr(feature = "clap", derive(clap::Args, PartialEq, Eq))]
789+
#[cfg_attr(
790+
feature = "clap",
791+
derive(clap::Args, PartialEq, Eq),
792+
command(next_help_heading = "Telemetry Options")
793+
)]
790794
#[derive(Debug, Default)]
791795
pub struct TelemetryOptions {
792796
/// Disable console logs.

0 commit comments

Comments
 (0)