fix: unjank the demo #85

Merged
taha merged 19 commits from fix_demo into master 2025-07-11 14:32:22 +00:00
Showing only changes of commit a9aa989b66 - Show all commits

View File

@ -1,4 +1,5 @@
use async_trait::async_trait;
use kube::api::{ApiResource, GroupVersionKind};
use log::error;
use non_blank_string_rs::NonBlankString;
use serde::Serialize;
@ -56,9 +57,16 @@ impl<T: Topology + K8sclient + HelmCommand> Interpret<T> for ArgoInterpret {
.execute(inventory, topology)
.await?;
let gvk = GroupVersionKind::gvk("argoproj.io", "v1alpha1", "Application");
let api_resource = ApiResource::from_gvk_with_plural(&gvk, "applications");

This is binding Harmony's usage to kube-rs API, which is wrong.

I think it would be doable to extract the gvk from the manifest itself and have apply_yaml return Err("Could not build gvk from input yaml, missing property {missing_property}") . Then I think the only missing bit will be the plural which is not kube-rs specific so more acceptable.

This is binding Harmony's usage to kube-rs API, which is wrong. I think it would be doable to extract the gvk from the manifest itself and have `apply_yaml` return `Err("Could not build gvk from input yaml, missing property {missing_property}")` . Then I think the only missing bit will be the plural which is not kube-rs specific so more acceptable.
let k8s_client = topology.k8s_client().await?;
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
.unwrap();
Ok(Outcome::success(format!(