fix check to ensure prometheus operator is installed
This commit is contained in:
parent
056152a1e5
commit
9403581be5
@ -271,11 +271,11 @@ impl K8sAnywhereTopology {
|
||||
&self,
|
||||
sender: &CRDPrometheus,
|
||||
) -> Result<Outcome, InterpretError> {
|
||||
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(),
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user