diff --git a/harmony/src/domain/topology/k8s_anywhere.rs b/harmony/src/domain/topology/k8s_anywhere.rs index b072373..8ffbf75 100644 --- a/harmony/src/domain/topology/k8s_anywhere.rs +++ b/harmony/src/domain/topology/k8s_anywhere.rs @@ -271,11 +271,11 @@ impl K8sAnywhereTopology { &self, sender: &CRDPrometheus, ) -> Result { - let output = Command::new("sh") + let status = Command::new("sh") .args(["-c", "kubectl get crd -A | grep -i prometheuses"]) - .output() + .status() .map_err(|e| InterpretError::new(format!("could not connect to cluster: {}", e)))?; - if output.status.success() && output.stdout.is_empty() { + if !status.success() { if let Some(Some(k8s_state)) = self.k8s_state.get() { match k8s_state.source { K8sSource::LocalK3d => { @@ -300,7 +300,9 @@ impl K8sAnywhereTopology { return Ok(Outcome::noop()); } } + debug!("Prometheus operator is already present, skipping install"); + Ok(Outcome::success( "prometheus operator present in cluster".to_string(), ))