fix: couple of changes to get a test working

This commit is contained in:
Taha Hawa 2025-04-23 15:31:02 -04:00
parent ff830486af
commit 9345e63a32
2 changed files with 12 additions and 7 deletions

View File

@ -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 {}

View File

@ -17,13 +17,15 @@ pub struct HelmChartScore {
pub namespace: Option<NonBlankString>,
pub release_name: NonBlankString,
pub chart_name: NonBlankString,
pub chart_version: NonBlankString,
pub chart_version: Option<NonBlankString>,
pub values_overrides: Option<HashMap<NonBlankString, String>>,
}
impl<T: Topology> Score<T> for HelmChartScore {
impl<T: Topology + HelmCommand> Score<T> for HelmChartScore {
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
todo!()
Box::new(HelmChartInterpret {
score: self.clone(),
})
}
fn name(&self) -> String {
@ -47,13 +49,13 @@ impl<T: Topology + HelmCommand> Interpret<T> 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,