Skip to content

Commit 53d8c9f

Browse files
committed
fix tests
1 parent 3d5c01e commit 53d8c9f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

crates/stackable-operator/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,12 @@ impl Client {
516516
/// use tokio::time::error::Elapsed;
517517
/// use kube::runtime::watcher;
518518
/// use k8s_openapi::api::core::v1::Pod;
519-
/// use stackable_operator::client::{Client, create_client};
519+
/// use stackable_operator::client::{Client, initialize_operator};
520520
///
521521
/// #[tokio::main]
522522
/// async fn main(){
523523
///
524-
/// let client: Client = create_client(None).await.expect("Unable to construct client.");
524+
/// let client: Client = initialize_operator(None).await.expect("Unable to construct client.");
525525
/// let watcher_config: watcher::Config =
526526
/// watcher::Config::default().fields(&format!("metadata.name=nonexistent-pod"));
527527
///

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,17 @@ pub enum Error {
6060
///
6161
/// # Usage
6262
///
63-
/// ```
63+
/// ```no_run
64+
/// use stackable_operator::client::{Client, initialize_operator};
6465
/// use stackable_operator::utils::KUBERNETES_CLUSTER_DOMAIN;
6566
///
66-
/// let kubernetes_cluster_domain = KUBERNETES_CLUSTER_DOMAIN.get().expect("Could not resolve the Kubernetes cluster domain!");
67-
/// tracing::info!("Found cluster domain: {kubernetes_cluster_domain}");
67+
/// #[tokio::main]
68+
/// async fn main(){
69+
/// let client: Client = initialize_operator(None).await.expect("Unable to construct client.");
70+
/// let kubernetes_cluster_domain = KUBERNETES_CLUSTER_DOMAIN.get().expect("Could not resolve the Kubernetes cluster domain!");
71+
/// tracing::info!("Found cluster domain: {kubernetes_cluster_domain}");
72+
/// }
6873
/// ```
69-
///
7074
pub static KUBERNETES_CLUSTER_DOMAIN: OnceLock<DomainName> = OnceLock::new();
7175

7276
pub(crate) fn resolve_kubernetes_cluster_domain() -> Result<DomainName, Error> {
@@ -101,7 +105,7 @@ pub(crate) fn resolve_kubernetes_cluster_domain() -> Result<DomainName, Error> {
101105
// 3. Read and parse 'resolv.conf'. We are looking for the last "search" entry and filter for the shortest
102106
// element in that search line
103107
tracing::info!(
104-
"Running in clusterized environment. Attempting to parse '{RESOLVE_CONF_FILE_PATH}' ..."
108+
"Running in clusterized environment. Attempting to parse '{RESOLVE_CONF_FILE_PATH}'..."
105109
);
106110
let resolve_conf_lines =
107111
read_file_from_path(RESOLVE_CONF_FILE_PATH).context(ResolvConfNotFoundSnafu {

0 commit comments

Comments
 (0)