working on ensure_ready to check helm is available #17
| @ -38,7 +38,7 @@ impl K8sAnywhereTopology { | ||||
| 
 | ||||
|     fn is_helm_available(&self) -> Result<(), String> { | ||||
|         let version_result = Command::new("helm") | ||||
|             .arg("-version") | ||||
|             .arg("version") | ||||
|             .output() | ||||
|             .map_err(|e| format!("Failed to execute 'helm -version': {}", e))?; | ||||
| 
 | ||||
| @ -155,16 +155,20 @@ impl Topology for K8sAnywhereTopology { | ||||
|             .k8s_state | ||||
|             .get_or_try_init(|| self.try_get_or_install_k8s_client()) | ||||
|             .await?; | ||||
|         //{
 | ||||
|         //    Some(k8s_state) => Ok(Outcome::success(k8s_state.message.clone())),
 | ||||
|         //    None => Err(InterpretError::new("No K8s client could be found or installed".to_string(),
 | ||||
|         //            )),
 | ||||
|         //}
 | ||||
| 
 | ||||
|         let k8s_state: &K8sState = k8s_state | ||||
|             .as_ref() | ||||
|             .ok_or(InterpretError::new( | ||||
|                 "No K8s client could be found or installed".to_string(), | ||||
|             ))?; | ||||
|         
 | ||||
|         match self.is_helm_available() { | ||||
|             Ok(()) => Ok(Outcome::success("helm available".to_string())), | ||||
|             Ok(()) => Ok(Outcome::success(format!( | ||||
|                         "{} + helm available", | ||||
|                         k8s_state.message.clone() | ||||
|                         ))), | ||||
|             Err(_) => Err(InterpretError::new("helm unavailable".to_string())), | ||||
|         } | ||||
|         
 | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user