feat(HelmScore): Add values yaml option to helm chart score #23

Merged
taha merged 3 commits from add-helm-values-yaml into master 2025-04-29 16:09:05 +00:00
Showing only changes of commit d7b38ab6d2 - Show all commits

View File

@ -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;
Review

No need for a mut here. This would be more readable as a match :

let yaml_path = match self.score.values_yaml {
  Some(yaml) => { temp_file... do the work }
  None => None
};
No need for a mut here. This would be more readable as a match : ```rust let yaml_path = match self.score.values_yaml { Some(yaml) => { temp_file... do the work } None => None }; ```
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(