unjank argo app yaml

This commit is contained in:
tahahawa 2025-07-09 00:13:42 -04:00
parent 0faf85d850
commit a9aa989b66

View File

@ -1,4 +1,5 @@
use async_trait::async_trait; use async_trait::async_trait;
use kube::api::{ApiResource, GroupVersionKind};
use log::error; use log::error;
use non_blank_string_rs::NonBlankString; use non_blank_string_rs::NonBlankString;
use serde::Serialize; use serde::Serialize;
@ -56,9 +57,16 @@ impl<T: Topology + K8sclient + HelmCommand> Interpret<T> for ArgoInterpret {
.execute(inventory, topology) .execute(inventory, topology)
.await?; .await?;
let gvk = GroupVersionKind::gvk("argoproj.io", "v1alpha1", "Application");
let api_resource = ApiResource::from_gvk_with_plural(&gvk, "applications");
let k8s_client = topology.k8s_client().await?; let k8s_client = topology.k8s_client().await?;
k8s_client k8s_client
.apply_yaml_many(&self.argo_apps.iter().map(|a| a.to_yaml()).collect(), None) .apply_yaml_many(
&api_resource,
&self.argo_apps.iter().map(|a| a.to_yaml()).collect(),
None,
)
.await .await
.unwrap(); .unwrap();
Ok(Outcome::success(format!( Ok(Outcome::success(format!(