fix: unjank the demo #85

Merged
taha merged 19 commits from fix_demo into master 2025-07-11 14:32:22 +00:00
2 changed files with 12 additions and 10 deletions
Showing only changes of commit 694f0dc045 - Show all commits

View File

@ -4,12 +4,10 @@ use harmony::{
inventory::Inventory,
maestro::Maestro,
modules::application::{
ApplicationScore, RustWebFramework, RustWebapp,
features::{ContinuousDelivery, Monitoring},
},
topology::{
K8sAnywhereTopology, Url,
ApplicationScore, RustWebFramework, RustWebapp,
features::{ContinuousDelivery, Monitoring},
},
topology::{K8sAnywhereTopology, Url},
};
#[tokio::main]

View File

@ -1,3 +1,5 @@
use std::sync::Arc;
use async_trait::async_trait;
use base64::{Engine as _, engine::general_purpose};
use log::{debug, info};
@ -5,7 +7,7 @@ use log::{debug, info};
use crate::{
inventory::Inventory,
modules::{
application::ApplicationFeature,
application::{ApplicationFeature, OCICompliant},
monitoring::{
alert_channel::webhook_receiver::WebhookReceiver,
kube_prometheus::{
@ -19,8 +21,10 @@ use crate::{
topology::{HelmCommand, K8sclient, Topology, Url, tenant::TenantManager},
};
#[derive(Debug, Default, Clone)]
pub struct Monitoring {}
#[derive(Debug, Clone)]
taha marked this conversation as resolved Outdated
Outdated
Review

if we add pub application: Arc to monitoring we can use the application name as namespace so that it is consistent with the way continuous _delivery feature gets the namespace

if we add pub application: Arc<dyn Application> to monitoring we can use the application name as namespace so that it is consistent with the way continuous _delivery feature gets the namespace
pub struct Monitoring {
pub application: Arc<dyn OCICompliant>,
}
#[async_trait]
impl<T: Topology + HelmCommand + K8sclient + 'static + TenantManager> ApplicationFeature<T>
@ -35,7 +39,7 @@ impl<T: Topology + HelmCommand + K8sclient + 'static + TenantManager> Applicatio
// .await
taha marked this conversation as resolved
Review

rather than hardcoding namespace here

rather than hardcoding namespace here
// .expect("couldn't get tenant config")
// .name,
namespace: "harmonydemo-staging".to_string(),
namespace: self.application.name(),
host: "localhost".to_string(),
};
ntfy.create_interpret()
@ -66,7 +70,7 @@ impl<T: Topology + HelmCommand + K8sclient + 'static + TenantManager> Applicatio
url::Url::parse(
format!(
"http://ntfy.{}.svc.cluster.local/rust-web-app?auth={ntfy_default_auth_param}",
"harmonydemo-staging".to_string()
self.application.name()
)
.as_str(),
)