Skip to content

Commit c0b3650

Browse files
committed
KubernetesClusterInfoCliOpts -> KubernetesClusterInfoOpts
1 parent ce51bc5 commit c0b3650

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

crates/stackable-operator/src/cli.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ use snafu::{ResultExt, Snafu};
117117

118118
use crate::{
119119
logging::TracingTarget, namespace::WatchNamespace,
120-
utils::cluster_info::KubernetesClusterInfoCliOpts,
120+
utils::cluster_info::KubernetesClusterInfoOpts,
121121
};
122122

123123
pub const AUTHOR: &str = "Stackable GmbH - info@stackable.tech";
@@ -177,7 +177,7 @@ pub enum Command<Run: Args = ProductOperatorRun> {
177177
/// use stackable_operator::{
178178
/// logging::TracingTarget,
179179
/// namespace::WatchNamespace,
180-
/// utils::cluster_info::KubernetesClusterInfoCliOpts
180+
/// utils::cluster_info::KubernetesClusterInfoOpts
181181
/// };
182182
///
183183
/// let opts = Command::<Run>::parse_from(["foobar-operator", "run", "--name", "foo", "--product-config", "bar", "--watch-namespace", "foobar"]);
@@ -187,7 +187,7 @@ pub enum Command<Run: Args = ProductOperatorRun> {
187187
/// product_config: ProductConfigPath::from("bar".as_ref()),
188188
/// watch_namespace: WatchNamespace::One("foobar".to_string()),
189189
/// tracing_target: TracingTarget::None,
190-
/// cluster_info_opts: KubernetesClusterInfoCliOpts {
190+
/// cluster_info_opts: KubernetesClusterInfoOpts {
191191
/// kubernetes_cluster_domain: None
192192
/// }
193193
/// },
@@ -225,7 +225,7 @@ pub struct ProductOperatorRun {
225225
pub tracing_target: TracingTarget,
226226

227227
#[command(flatten)]
228-
pub cluster_info_opts: KubernetesClusterInfoCliOpts,
228+
pub cluster_info_opts: KubernetesClusterInfoOpts,
229229
}
230230

231231
/// A path to a [`ProductConfigManager`] spec file
@@ -399,7 +399,7 @@ mod tests {
399399
product_config: ProductConfigPath::from("bar".as_ref()),
400400
watch_namespace: WatchNamespace::One("foo".to_string()),
401401
tracing_target: TracingTarget::None,
402-
cluster_info_opts: KubernetesClusterInfoCliOpts {
402+
cluster_info_opts: KubernetesClusterInfoOpts {
403403
kubernetes_cluster_domain: None
404404
}
405405
}
@@ -413,7 +413,7 @@ mod tests {
413413
product_config: ProductConfigPath::from("bar".as_ref()),
414414
watch_namespace: WatchNamespace::All,
415415
tracing_target: TracingTarget::None,
416-
cluster_info_opts: KubernetesClusterInfoCliOpts {
416+
cluster_info_opts: KubernetesClusterInfoOpts {
417417
kubernetes_cluster_domain: None
418418
}
419419
}
@@ -428,7 +428,7 @@ mod tests {
428428
product_config: ProductConfigPath::from("bar".as_ref()),
429429
watch_namespace: WatchNamespace::One("foo".to_string()),
430430
tracing_target: TracingTarget::None,
431-
cluster_info_opts: KubernetesClusterInfoCliOpts {
431+
cluster_info_opts: KubernetesClusterInfoOpts {
432432
kubernetes_cluster_domain: None
433433
}
434434
}

crates/stackable-operator/src/client.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use tracing::trace;
2121

2222
use crate::{
2323
kvp::LabelSelectorExt,
24-
utils::cluster_info::{KubernetesClusterInfo, KubernetesClusterInfoCliOpts},
24+
utils::cluster_info::{KubernetesClusterInfo, KubernetesClusterInfoOpts},
2525
};
2626

2727
pub type Result<T, E = Error> = std::result::Result<T, E>;
@@ -523,13 +523,13 @@ impl Client {
523523
/// use k8s_openapi::api::core::v1::Pod;
524524
/// use stackable_operator::{
525525
/// client::{Client, initialize_operator},
526-
/// utils::cluster_info::KubernetesClusterInfoCliOpts
526+
/// utils::cluster_info::KubernetesClusterInfoOpts
527527
/// };
528528
///
529529
/// #[tokio::main]
530530
/// async fn main() {
531531
///
532-
/// let cluster_info_cli_opts = KubernetesClusterInfoCliOpts {
532+
/// let cluster_info_cli_opts = KubernetesClusterInfoOpts {
533533
/// kubernetes_cluster_domain: None,
534534
/// };
535535
/// let client = initialize_operator(None, &cluster_info_cli_opts)
@@ -643,7 +643,7 @@ where
643643

644644
pub async fn initialize_operator(
645645
field_manager: Option<String>,
646-
cluster_info_cli_opts: &KubernetesClusterInfoCliOpts,
646+
cluster_info_cli_opts: &KubernetesClusterInfoOpts,
647647
) -> Result<Client> {
648648
let kubeconfig: Config = kube::Config::infer()
649649
.await
@@ -676,12 +676,12 @@ mod tests {
676676
};
677677
use tokio::time::error::Elapsed;
678678

679-
use crate::utils::cluster_info::KubernetesClusterInfoCliOpts;
679+
use crate::utils::cluster_info::KubernetesClusterInfoOpts;
680680

681681
#[tokio::test]
682682
#[ignore = "Tests depending on Kubernetes are not ran by default"]
683683
async fn k8s_test_wait_created() {
684-
let cluster_info_cli_opts = KubernetesClusterInfoCliOpts {
684+
let cluster_info_cli_opts = KubernetesClusterInfoOpts {
685685
kubernetes_cluster_domain: None,
686686
};
687687
let client = super::initialize_operator(None, &cluster_info_cli_opts)
@@ -762,7 +762,7 @@ mod tests {
762762
#[tokio::test]
763763
#[ignore = "Tests depending on Kubernetes are not ran by default"]
764764
async fn k8s_test_wait_created_timeout() {
765-
let cluster_info_cli_opts = KubernetesClusterInfoCliOpts {
765+
let cluster_info_cli_opts = KubernetesClusterInfoOpts {
766766
kubernetes_cluster_domain: None,
767767
};
768768
let client = super::initialize_operator(None, &cluster_info_cli_opts)
@@ -785,7 +785,7 @@ mod tests {
785785
#[tokio::test]
786786
#[ignore = "Tests depending on Kubernetes are not ran by default"]
787787
async fn k8s_test_list_with_label_selector() {
788-
let cluster_info_cli_opts = KubernetesClusterInfoCliOpts {
788+
let cluster_info_cli_opts = KubernetesClusterInfoOpts {
789789
kubernetes_cluster_domain: None,
790790
};
791791
let client = super::initialize_operator(None, &cluster_info_cli_opts)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct KubernetesClusterInfo {
1010
}
1111

1212
#[derive(clap::Parser, Debug, PartialEq, Eq)]
13-
pub struct KubernetesClusterInfoCliOpts {
13+
pub struct KubernetesClusterInfoOpts {
1414
/// Kubernetes cluster domain, usually this is `cluster.local`.
1515
// We are not using a default value here, as operators will probably do an more advanced
1616
// auto-detection of the cluster domain in case it is not specified in the future.
@@ -19,7 +19,7 @@ pub struct KubernetesClusterInfoCliOpts {
1919
}
2020

2121
impl KubernetesClusterInfo {
22-
pub fn new(cluster_info_cli_opts: &KubernetesClusterInfoCliOpts) -> Self {
22+
pub fn new(cluster_info_cli_opts: &KubernetesClusterInfoOpts) -> Self {
2323
let cluster_domain = match &cluster_info_cli_opts.kubernetes_cluster_domain {
2424
Some(cluster_domain) => {
2525
tracing::info!(%cluster_domain, "Using configured Kubernetes cluster domain");

0 commit comments

Comments
 (0)