Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maltesander committed Oct 16, 2024
1 parent 3d5c01e commit 53d8c9f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/stackable-operator/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,12 @@ impl Client {
/// use tokio::time::error::Elapsed;
/// use kube::runtime::watcher;
/// use k8s_openapi::api::core::v1::Pod;
/// use stackable_operator::client::{Client, create_client};
/// use stackable_operator::client::{Client, initialize_operator};
///
/// #[tokio::main]
/// async fn main(){
///
/// let client: Client = create_client(None).await.expect("Unable to construct client.");
/// let client: Client = initialize_operator(None).await.expect("Unable to construct client.");
/// let watcher_config: watcher::Config =
/// watcher::Config::default().fields(&format!("metadata.name=nonexistent-pod"));
///
Expand Down
14 changes: 9 additions & 5 deletions crates/stackable-operator/src/utils/cluster_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ pub enum Error {
///
/// # Usage
///
/// ```
/// ```no_run
/// use stackable_operator::client::{Client, initialize_operator};
/// use stackable_operator::utils::KUBERNETES_CLUSTER_DOMAIN;
///
/// let kubernetes_cluster_domain = KUBERNETES_CLUSTER_DOMAIN.get().expect("Could not resolve the Kubernetes cluster domain!");
/// tracing::info!("Found cluster domain: {kubernetes_cluster_domain}");
/// #[tokio::main]
/// async fn main(){
/// let client: Client = initialize_operator(None).await.expect("Unable to construct client.");
/// let kubernetes_cluster_domain = KUBERNETES_CLUSTER_DOMAIN.get().expect("Could not resolve the Kubernetes cluster domain!");
/// tracing::info!("Found cluster domain: {kubernetes_cluster_domain}");
/// }
/// ```
///
pub static KUBERNETES_CLUSTER_DOMAIN: OnceLock<DomainName> = OnceLock::new();

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

0 comments on commit 53d8c9f

Please sign in to comment.