fix: couple of changes to get a test working
This commit is contained in:
parent
ff830486af
commit
9345e63a32
@ -3,7 +3,7 @@ use derive_new::new;
|
|||||||
|
|
||||||
use crate::interpret::{InterpretError, Outcome};
|
use crate::interpret::{InterpretError, Outcome};
|
||||||
|
|
||||||
use super::Topology;
|
use super::{HelmCommand, Topology};
|
||||||
|
|
||||||
#[derive(new)]
|
#[derive(new)]
|
||||||
pub struct LocalhostTopology;
|
pub struct LocalhostTopology;
|
||||||
@ -20,3 +20,6 @@ impl Topology for LocalhostTopology {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Delete this, temp for test
|
||||||
|
impl HelmCommand for LocalhostTopology {}
|
||||||
|
|||||||
@ -17,13 +17,15 @@ pub struct HelmChartScore {
|
|||||||
pub namespace: Option<NonBlankString>,
|
pub namespace: Option<NonBlankString>,
|
||||||
pub release_name: NonBlankString,
|
pub release_name: NonBlankString,
|
||||||
pub chart_name: NonBlankString,
|
pub chart_name: NonBlankString,
|
||||||
pub chart_version: NonBlankString,
|
pub chart_version: Option<NonBlankString>,
|
||||||
pub values_overrides: Option<HashMap<NonBlankString, String>>,
|
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>> {
|
fn create_interpret(&self) -> Box<dyn Interpret<T>> {
|
||||||
todo!()
|
Box::new(HelmChartInterpret {
|
||||||
|
score: self.clone(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name(&self) -> String {
|
fn name(&self) -> String {
|
||||||
@ -47,13 +49,13 @@ impl<T: Topology + HelmCommand> Interpret<T> for HelmChartInterpret {
|
|||||||
.score
|
.score
|
||||||
.namespace
|
.namespace
|
||||||
.as_ref()
|
.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 helm_executor = DefaultHelmExecutor::new();
|
||||||
let res = helm_executor.install_or_upgrade(
|
let res = helm_executor.install_or_upgrade(
|
||||||
ns,
|
&ns,
|
||||||
&self.score.release_name,
|
&self.score.release_name,
|
||||||
&self.score.chart_name,
|
&self.score.chart_name,
|
||||||
Some(&self.score.chart_version),
|
self.score.chart_version.as_ref(),
|
||||||
self.score.values_overrides.as_ref(),
|
self.score.values_overrides.as_ref(),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user