feat(HelmScore): Add values yaml option to helm chart score #23
| @ -52,12 +52,14 @@ impl<T: Topology + HelmCommand> Interpret<T> for HelmChartInterpret { | ||||
|             .as_ref() | ||||
|             .unwrap_or_else(|| todo!("Get namespace from active kubernetes cluster")); | ||||
| 
 | ||||
|         let mut yaml_path: Option<&Path> = None; | ||||
|         let tf: TempFile; | ||||
|  | ||||
|         if self.score.values_yaml.is_some() { | ||||
|             tf = temp_file::with_contents(self.score.values_yaml.as_ref().unwrap().as_bytes()); | ||||
|             yaml_path = Some(tf.path()); | ||||
|         } | ||||
|         let yaml_path: Option<&Path> = match self.score.values_yaml.as_ref() { | ||||
|             Some(yaml_str) => { | ||||
|                 tf = temp_file::with_contents(yaml_str.as_bytes()); | ||||
|                 Some(tf.path()) | ||||
|             } | ||||
|             None => None, | ||||
|         }; | ||||
| 
 | ||||
|         let helm_executor = DefaultHelmExecutor::new(); | ||||
|         let res = helm_executor.install_or_upgrade( | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	
No need for a mut here. This would be more readable as a match :