From bcf8055ab914daf3ea570803066084208f535aff Mon Sep 17 00:00:00 2001 From: Tianhao Geng Date: Fri, 7 Jul 2023 22:40:04 +0000 Subject: [PATCH] add namespace value to integration test we tried to infer the default namespace from the loaded kubeconfig, but the default namespace is `default` instead of `brupop-bottlerocket-aws` where BottlerocketShadow object locates on. Therefore, add namespace value on integration test. --- integ/src/main.rs | 6 +++--- integ/src/monitor.rs | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integ/src/main.rs b/integ/src/main.rs index 254e3ba0..fbad4a65 100644 --- a/integ/src/main.rs +++ b/integ/src/main.rs @@ -34,6 +34,8 @@ const AMI_ARCH: &str = "x86_64"; // The default name for the nodegroup const NODEGROUP_NAME: &str = "brupop-integ-test-nodegroup"; +const NAMESPACE: &str = "brupop-bottlerocket-aws"; + const WAIT_CERT_MANAGER_COMPLETE: tokio::time::Duration = tokio::time::Duration::from_secs(90); lazy_static! { @@ -218,13 +220,11 @@ async fn run() -> Result<()> { .await .context(error::LoadKubeConfigSnafu)?; - // infer the default namespace from the loaded kubeconfig - let namespace = config.default_namespace.to_string(); let k8s_client = kube::client::Client::try_from(config).context(error::CreateK8sClientSnafu)?; info!("monitoring brupop"); - let monitor_client = BrupopMonitor::new(IntegBrupopClient::new(k8s_client, &namespace)); + let monitor_client = BrupopMonitor::new(IntegBrupopClient::new(k8s_client, NAMESPACE)); monitor_client .run_monitor() .await diff --git a/integ/src/monitor.rs b/integ/src/monitor.rs index 9a4494a2..b10c6fcb 100644 --- a/integ/src/monitor.rs +++ b/integ/src/monitor.rs @@ -53,6 +53,7 @@ impl BrupopClient for IntegBrupopClient { async fn fetch_shadows(&self) -> Result> { let brss: Api = Api::namespaced(self.k8s_client.clone(), &self.namespace); + let brss_object_list = brss .list(&ListParams::default()) .await