From 9345e63a322af3bdf2845d9e70bae4374aed4f3c Mon Sep 17 00:00:00 2001 From: Taha Hawa Date: Wed, 23 Apr 2025 15:31:02 -0400 Subject: [PATCH] fix: couple of changes to get a test working --- harmony/src/domain/topology/localhost.rs | 5 ++++- harmony/src/modules/helm/chart.rs | 14 ++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/harmony/src/domain/topology/localhost.rs b/harmony/src/domain/topology/localhost.rs index dfa1c0b..c5dcc75 100644 --- a/harmony/src/domain/topology/localhost.rs +++ b/harmony/src/domain/topology/localhost.rs @@ -3,7 +3,7 @@ use derive_new::new; use crate::interpret::{InterpretError, Outcome}; -use super::Topology; +use super::{HelmCommand, Topology}; #[derive(new)] pub struct LocalhostTopology; @@ -20,3 +20,6 @@ impl Topology for LocalhostTopology { )) } } + +// TODO: Delete this, temp for test +impl HelmCommand for LocalhostTopology {} diff --git a/harmony/src/modules/helm/chart.rs b/harmony/src/modules/helm/chart.rs index c4dad5e..08d2980 100644 --- a/harmony/src/modules/helm/chart.rs +++ b/harmony/src/modules/helm/chart.rs @@ -17,13 +17,15 @@ pub struct HelmChartScore { pub namespace: Option, pub release_name: NonBlankString, pub chart_name: NonBlankString, - pub chart_version: NonBlankString, + pub chart_version: Option, pub values_overrides: Option>, } -impl Score for HelmChartScore { +impl Score for HelmChartScore { fn create_interpret(&self) -> Box> { - todo!() + Box::new(HelmChartInterpret { + score: self.clone(), + }) } fn name(&self) -> String { @@ -47,13 +49,13 @@ impl Interpret for HelmChartInterpret { .score .namespace .as_ref() - .unwrap_or(todo!("Get namespace from active kubernetes cluster")); + .unwrap_or_else(|| todo!("Get namespace from active kubernetes cluster")); let helm_executor = DefaultHelmExecutor::new(); let res = helm_executor.install_or_upgrade( - ns, + &ns, &self.score.release_name, &self.score.chart_name, - Some(&self.score.chart_version), + self.score.chart_version.as_ref(), self.score.values_overrides.as_ref(), None, None,