From 86c67f4b3ab7b5ba81c12c72a950ebd77eca3e5f Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Tue, 4 Jun 2024 11:35:12 +0300 Subject: [PATCH] debug prints --- mirrord/cli/src/connection.rs | 2 ++ mirrord/kube/src/api/kubernetes.rs | 4 ++-- mirrord/kube/src/api/runtime.rs | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mirrord/cli/src/connection.rs b/mirrord/cli/src/connection.rs index 2f88e6bf13b..23c114b7cba 100644 --- a/mirrord/cli/src/connection.rs +++ b/mirrord/cli/src/connection.rs @@ -10,6 +10,7 @@ use mirrord_progress::{ }; use mirrord_protocol::{ClientMessage, DaemonMessage}; use tokio::sync::mpsc; +use tracing::debug; use crate::{CliError, Result}; @@ -150,6 +151,7 @@ where .map_err(|_| CliError::AgentReadyTimeout)? .map_err(CliError::CreateAgentFailed)?; + debug!("agent created"); let (sender, receiver) = wrap_raw_connection( k8s_api .create_connection(agent_connect_info.clone()) diff --git a/mirrord/kube/src/api/kubernetes.rs b/mirrord/kube/src/api/kubernetes.rs index 5cd84eecbf6..029690b335d 100644 --- a/mirrord/kube/src/api/kubernetes.rs +++ b/mirrord/kube/src/api/kubernetes.rs @@ -201,7 +201,7 @@ impl KubernetesAPI { /// * `tls_cert` - value for /// [`AGENT_OPERATOR_CERT_ENV`](mirrord_protocol::AGENT_OPERATOR_CERT_ENV), for creating an /// agent from the operator. In usage from this repo this is always `None`. - #[tracing::instrument(level = "trace", skip(self, progress))] + #[tracing::instrument(level = "debug", skip(self, progress))] pub async fn create_agent

( &self, progress: &mut P, @@ -213,7 +213,7 @@ impl KubernetesAPI { P: Progress + Send + Sync, { let (params, runtime_data) = self.create_agent_params(target, tls_cert).await?; - + debug!("create agent params passed"); let incoming_mode = config.map(|config| config.feature.network.incoming.mode); let is_mesh = runtime_data .as_ref() diff --git a/mirrord/kube/src/api/runtime.rs b/mirrord/kube/src/api/runtime.rs index f35aa8465d6..268f0085aac 100644 --- a/mirrord/kube/src/api/runtime.rs +++ b/mirrord/kube/src/api/runtime.rs @@ -15,6 +15,7 @@ use mirrord_config::target::Target; use mirrord_protocol::MeshVendor; use serde::de::DeserializeOwned; use thiserror::Error; +use tracing::debug; use crate::{ api::{container::choose_container, kubernetes::get_k8s_resource_api}, @@ -252,10 +253,13 @@ where async fn runtime_data(&self, client: &Client, namespace: Option<&str>) -> Result { let api: Api<::Resource> = get_k8s_resource_api(client, namespace); + debug!("getting resource: {name}", name = self.name()); let resource = api.get(self.name()).await?; + debug!(?resource, "getting labels for resource"); let labels = Self::get_labels(&resource).await?; + debug!(?labels, "got labels for resource"); let formatted_labels = labels .iter() .map(|(key, value)| format!("{key}={value}")) @@ -266,7 +270,9 @@ where ..Default::default() }; + debug!(?list_params, "list_params"); let pod_api: Api = get_k8s_resource_api(client, namespace); + debug!(?list_params, "listing pods"); let pods = pod_api.list(&list_params).await?; if pods.items.is_empty() {