Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
10 changes: 10 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Add a `CommonStackableCliArgs` struct, which can be used for non-operator Stackable tools ([#1083]).

### Changed

- BREAKING: The `telemetry` and `cluster_info` fields of `ProductOperatorRun` have moved below the `common` field ([#1083]).

[#1083]: https://github.com/stackabletech/operator-rs/pull/1083

## [0.95.1] - 2025-08-21

### Fixed
Expand Down
31 changes: 22 additions & 9 deletions crates/stackable-operator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub enum Command<Run: Args = ProductOperatorRun> {
/// Can be embedded into an extended argument set:
///
/// ```rust
/// # use stackable_operator::cli::{Command, OperatorEnvironmentOptions, ProductOperatorRun, ProductConfigPath};
/// # use stackable_operator::cli::{Command, CommonStackableCliArgs, OperatorEnvironmentOptions, ProductOperatorRun, ProductConfigPath};
/// # use stackable_operator::{namespace::WatchNamespace, utils::cluster_info::KubernetesClusterInfoOptions};
/// # use stackable_telemetry::tracing::TelemetryOptions;
/// use clap::Parser;
Expand Down Expand Up @@ -195,13 +195,15 @@ pub enum Command<Run: Args = ProductOperatorRun> {
/// assert_eq!(opts, Command::Run(Run {
/// name: "foo".to_string(),
/// common: ProductOperatorRun {
/// common: CommonStackableCliArgs {
/// telemetry: TelemetryOptions::default(),
/// cluster_info: KubernetesClusterInfoOptions {
/// kubernetes_cluster_domain: None,
/// kubernetes_node_name: "baz".to_string(),
/// },
/// },
/// product_config: ProductConfigPath::from("bar".as_ref()),
/// watch_namespace: WatchNamespace::One("foobar".to_string()),
/// telemetry: TelemetryOptions::default(),
/// cluster_info: KubernetesClusterInfoOptions {
/// kubernetes_cluster_domain: None,
/// kubernetes_node_name: "baz".to_string(),
/// },
/// operator_environment: OperatorEnvironmentOptions {
/// operator_namespace: "stackable-operators".to_string(),
/// operator_service_name: "foo-operator".to_string(),
Expand Down Expand Up @@ -230,17 +232,28 @@ pub enum Command<Run: Args = ProductOperatorRun> {
#[derive(clap::Parser, Debug, PartialEq, Eq)]
#[command(long_about = "")]
pub struct ProductOperatorRun {
#[command(flatten)]
pub common: CommonStackableCliArgs,

#[command(flatten)]
pub operator_environment: OperatorEnvironmentOptions,

/// Provides the path to a product-config file
#[arg(long, short = 'p', value_name = "FILE", default_value = "", env)]
pub product_config: ProductConfigPath,

/// Provides a specific namespace to watch (instead of watching all namespaces)
#[arg(long, env, default_value = "")]
pub watch_namespace: WatchNamespace,
}

#[command(flatten)]
pub operator_environment: OperatorEnvironmentOptions,

/// All the CLI arguments that all (or at least most) Stackable applications use.
///
/// [`ProductOperatorRun`] is intended for operators, but it has fields that are not needed for
/// utilities such as `user-info-fetcher` or `opa-bundle-builder`. So this struct offers a limited
/// set, that should be shared across all Stackable tools running on Kubernetes.
#[derive(clap::Parser, Debug, PartialEq, Eq)]
pub struct CommonStackableCliArgs {
#[command(flatten)]
pub telemetry: TelemetryOptions,

Expand Down
Loading