Skip to content

Commit

Permalink
debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha committed Jun 4, 2024
1 parent 788af2c commit 86c67f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mirrord/cli/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use mirrord_progress::{
};
use mirrord_protocol::{ClientMessage, DaemonMessage};
use tokio::sync::mpsc;
use tracing::debug;

use crate::{CliError, Result};

Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions mirrord/kube/src/api/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<P>(
&self,
progress: &mut P,
Expand All @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions mirrord/kube/src/api/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -252,10 +253,13 @@ where
async fn runtime_data(&self, client: &Client, namespace: Option<&str>) -> Result<RuntimeData> {
let api: Api<<Self as RuntimeDataFromLabels>::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}"))
Expand All @@ -266,7 +270,9 @@ where
..Default::default()
};

debug!(?list_params, "list_params");
let pod_api: Api<Pod> = get_k8s_resource_api(client, namespace);
debug!(?list_params, "listing pods");
let pods = pod_api.list(&list_params).await?;

if pods.items.is_empty() {
Expand Down

0 comments on commit 86c67f4

Please sign in to comment.