fix: install_prometheus takes inventory from the maestro rather than inventory::autoload

This commit is contained in:
Willem 2025-06-20 09:12:54 -04:00 committed by tahahawa
parent 3c20574e6f
commit b1755c183d
2 changed files with 9 additions and 6 deletions

View File

@ -13,7 +13,8 @@ pub trait AlertSender: Send + Sync + std::fmt::Debug + Installable {
fn name(&self) -> String; fn name(&self) -> String;
async fn install<T: Topology + HelmCommand>( async fn install<T: Topology + HelmCommand>(
&self, &self,
topology: T, inventory: &Inventory,
topology: &T,
) -> Result<Outcome, InterpretError>; ) -> Result<Outcome, InterpretError>;
} }
@ -33,7 +34,7 @@ impl<S: AlertSender + Installable, T: Topology> Interpret<T> for AlertingInterpr
for receiver in self.receivers.iter() { for receiver in self.receivers.iter() {
receiver.install(&self.sender).await?; receiver.install(&self.sender).await?;
} }
self.sender.ensure_installed(); self.sender.ensure_installed().await?;
Ok(Outcome::success(format!( Ok(Outcome::success(format!(
"successfully installed alert sender {}", "successfully installed alert sender {}",
self.sender.name() self.sender.name()

View File

@ -27,9 +27,10 @@ impl AlertSender for Prometheus {
} }
async fn install<T: Topology + HelmCommand + Send + Sync>( async fn install<T: Topology + HelmCommand + Send + Sync>(
&self, &self,
topology: T, inventory: &Inventory,
topology: &T,
) -> Result<Outcome, InterpretError> { ) -> Result<Outcome, InterpretError> {
let _ = self.install_prometheus(topology).await; let _ = self.install_prometheus(inventory, topology).await;
todo!() todo!()
} }
} }
@ -91,11 +92,12 @@ impl Prometheus {
pub async fn install_prometheus<T: Topology + HelmCommand + Send + Sync>( pub async fn install_prometheus<T: Topology + HelmCommand + Send + Sync>(
&self, &self,
topology: T, inventory: &Inventory,
topology: &T,
) -> Result<Outcome, InterpretError> { ) -> Result<Outcome, InterpretError> {
kube_prometheus_helm_chart_score(self.config.clone()) kube_prometheus_helm_chart_score(self.config.clone())
.create_interpret() .create_interpret()
.execute(&Inventory::autoload(), &topology) .execute(inventory, topology)
.await .await
} }
} }