Add TODO for getting NS from kube, making it optional

This commit is contained in:
Taha Hawa 2025-04-23 14:21:19 -04:00
parent 217ca989ce
commit c270548e6e

View File

@ -14,7 +14,7 @@ use std::path::PathBuf;
#[derive(Debug, Clone, Serialize)]
pub struct HelmChartScore {
pub namespace: NonBlankString,
pub namespace: Option<NonBlankString>,
pub release_name: NonBlankString,
pub chart_name: NonBlankString,
pub chart_version: NonBlankString,
@ -43,9 +43,14 @@ impl<T: Topology + HelmCommand> Interpret<T> for HelmChartInterpret {
_inventory: &Inventory,
_topology: &T,
) -> Result<Outcome, InterpretError> {
let ns = self
.score
.namespace
.as_ref()
.unwrap_or(todo!("Get namespace from active kubernetes cluster"));
let helm_executor = DefaultHelmExecutor::new();
let res = helm_executor.install_or_upgrade(
&self.score.namespace,
ns,
&self.score.release_name,
&self.score.chart_name,
Some(&self.score.chart_version),