Skip to content

Commit 5e5fe71

Browse files
committed
fix: Remove excessive CLI arguments
1 parent eb14dc9 commit 5e5fe71

7 files changed

Lines changed: 60 additions & 48 deletions

File tree

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ product-config = { git = "https://github.com/stackabletech/product-config.git",
1414
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.95.0" }
1515
krb5 = { git = "https://github.com/stackabletech/krb5-rs.git", tag = "v0.1.0" }
1616

17-
1817
anyhow = "1.0"
1918
axum = "0.8"
2019
base64 = "0.22"
@@ -44,6 +43,6 @@ tracing = "0.1"
4443
url = "2.5"
4544
uuid = "1.10"
4645

47-
# [patch."https://github.com/stackabletech/operator-rs.git"]
48-
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
46+
[patch."https://github.com/stackabletech/operator-rs.git"]
47+
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "release/0.96.0" }
4948
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/bundle-builder/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use futures::{
1717
};
1818
use snafu::{ResultExt, Snafu};
1919
use stackable_operator::{
20+
cli::CommonOptions,
2021
k8s_openapi::api::core::v1::ConfigMap,
2122
kube::{
2223
api::ObjectMeta,
@@ -25,6 +26,7 @@ use stackable_operator::{
2526
watcher,
2627
},
2728
},
29+
namespace::WatchNamespace,
2830
telemetry::Tracing,
2931
};
3032
use tokio::net::TcpListener;
@@ -39,7 +41,11 @@ pub const APP_NAME: &str = "opa-bundle-builder";
3941
#[derive(clap::Parser)]
4042
pub struct Args {
4143
#[clap(flatten)]
42-
common: stackable_operator::cli::ProductOperatorRun,
44+
pub common: CommonOptions,
45+
46+
/// Provides a specific namespace to watch (instead of watching all namespaces)
47+
#[arg(long, env, default_value = "")]
48+
pub watch_namespace: WatchNamespace,
4349
}
4450

4551
type Bundle = Vec<u8>;
@@ -121,7 +127,7 @@ async fn main() -> Result<(), StartupError> {
121127
let reflector = std::pin::pin!(reflector::reflector(
122128
store_w,
123129
watcher(
124-
args.common.watch_namespace.get_api::<ConfigMap>(&client),
130+
args.watch_namespace.get_api::<ConfigMap>(&client),
125131
watcher::Config::default().labels(&format!("{OPERATOR_NAME}/bundle")),
126132
),
127133
)

rust/operator-binary/src/main.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use product_config::ProductConfigManager;
99
use stackable_opa_operator::crd::{OPERATOR_NAME, OpaCluster, OpaClusterVersion, v1alpha1};
1010
use stackable_operator::{
1111
YamlSchema,
12-
cli::{Command, ProductOperatorRun},
12+
cli::{Command, CommonOptions, ProductOperatorRun},
1313
client::{self, Client},
1414
k8s_openapi::api::{
1515
apps::v1::DaemonSet,
@@ -71,11 +71,14 @@ async fn main() -> anyhow::Result<()> {
7171
operator_image,
7272
common:
7373
ProductOperatorRun {
74+
common:
75+
CommonOptions {
76+
telemetry,
77+
cluster_info,
78+
},
7479
product_config,
7580
watch_namespace,
7681
operator_environment: _,
77-
telemetry,
78-
cluster_info,
7982
},
8083
}) => {
8184
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:

rust/user-info-fetcher/src/main.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use reqwest::ClientBuilder;
1313
use serde::{Deserialize, Serialize};
1414
use snafu::{ResultExt, Snafu};
1515
use stackable_opa_operator::crd::user_info_fetcher::v1alpha1;
16-
use stackable_operator::{commons::tls_verification::TlsClientDetails, telemetry::Tracing};
16+
use stackable_operator::{
17+
cli::CommonOptions, commons::tls_verification::TlsClientDetails, telemetry::Tracing,
18+
};
1719
use tokio::net::TcpListener;
1820

1921
mod backend;
@@ -28,12 +30,14 @@ pub const APP_NAME: &str = "opa-user-info-fetcher";
2830

2931
#[derive(clap::Parser)]
3032
pub struct Args {
33+
#[clap(flatten)]
34+
common: CommonOptions,
35+
3136
#[clap(long, env)]
3237
config: PathBuf,
38+
3339
#[clap(long, env)]
3440
credentials_dir: PathBuf,
35-
#[clap(flatten)]
36-
common: stackable_operator::cli::ProductOperatorRun,
3741
}
3842

3943
#[derive(Clone)]

0 commit comments

Comments
 (0)