Skip to content

Commit fd4ecb7

Browse files
committed
Fix doctests too
1 parent b1d4550 commit fd4ecb7

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

crates/stackable-operator/src/cli.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub enum Command<Run: Args = ProductOperatorRun> {
165165
/// ```rust
166166
/// # use stackable_operator::cli::{Command, ProductOperatorRun, ProductConfigPath};
167167
/// use clap::Parser;
168-
/// use stackable_operator::namespace::WatchNamespace;
168+
/// use stackable_operator::{namespace::WatchNamespace, utils::cluster_info::KubernetesClusterInfoOpts};
169169
/// use stackable_telemetry::tracing::TelemetryOptions;
170170
///
171171
/// #[derive(clap::Parser, Debug, PartialEq, Eq)]
@@ -176,14 +176,17 @@ pub enum Command<Run: Args = ProductOperatorRun> {
176176
/// common: ProductOperatorRun,
177177
/// }
178178
///
179-
/// let opts = Command::<Run>::parse_from(["foobar-operator", "run", "--name", "foo", "--product-config", "bar", "--watch-namespace", "foobar"]);
179+
/// let opts = Command::<Run>::parse_from(["foobar-operator", "run", "--name", "foo", "--product-config", "bar", "--watch-namespace", "foobar", "--kubernetes-node-name", "baz"]);
180180
/// assert_eq!(opts, Command::Run(Run {
181181
/// name: "foo".to_string(),
182182
/// common: ProductOperatorRun {
183183
/// product_config: ProductConfigPath::from("bar".as_ref()),
184184
/// watch_namespace: WatchNamespace::One("foobar".to_string()),
185185
/// telemetry_arguments: TelemetryOptions::default(),
186-
/// cluster_info_opts: Default::default(),
186+
/// cluster_info_opts: KubernetesClusterInfoOpts {
187+
/// kubernetes_cluster_domain: None,
188+
/// kubernetes_node_name: "baz".to_string(),
189+
/// },
187190
/// },
188191
/// }));
189192
/// ```

crates/stackable-operator/src/client.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,19 @@ impl Client {
523523
///
524524
/// ```no_run
525525
/// use std::time::Duration;
526+
/// use clap::Parser;
526527
/// use tokio::time::error::Elapsed;
527528
/// use kube::runtime::watcher;
528529
/// use k8s_openapi::api::core::v1::Pod;
529-
/// use stackable_operator::client::{Client, initialize_operator};
530+
/// use stackable_operator::{
531+
/// client::{Client, initialize_operator},
532+
/// utils::cluster_info::KubernetesClusterInfoOpts,
533+
/// };
530534
///
531535
/// #[tokio::main]
532536
/// async fn main() {
533-
///
534-
/// let client = initialize_operator(None, &Default::default())
537+
/// let cluster_info_opts = KubernetesClusterInfoOpts::parse();
538+
/// let client = initialize_operator(None, &cluster_info_opts)
535539
/// .await
536540
/// .expect("Unable to construct client.");
537541
/// let watcher_config: watcher::Config =

0 commit comments

Comments
 (0)