fix:cargo fmt
This commit is contained in:
parent
b631e8ccbb
commit
7e3f1b1830
@ -15,9 +15,12 @@ use crate::{
|
||||
};
|
||||
|
||||
use super::{
|
||||
k8s::K8sClient, oberservability::notification_adapter_deployer::NotificationAdapterDeployer, tenant::{
|
||||
k8s::K8sTenantManager, ResourceLimits, TenantConfig, TenantManager, TenantNetworkPolicy
|
||||
}, HelmCommand, K8sclient, Topology
|
||||
HelmCommand, K8sclient, Topology,
|
||||
k8s::K8sClient,
|
||||
oberservability::notification_adapter_deployer::NotificationAdapterDeployer,
|
||||
tenant::{
|
||||
ResourceLimits, TenantConfig, TenantManager, TenantNetworkPolicy, k8s::K8sTenantManager,
|
||||
},
|
||||
};
|
||||
|
||||
struct K8sState {
|
||||
|
||||
@ -3,8 +3,8 @@ mod host_binding;
|
||||
mod http;
|
||||
mod k8s_anywhere;
|
||||
mod localhost;
|
||||
pub mod tenant;
|
||||
pub mod oberservability;
|
||||
pub mod tenant;
|
||||
pub use k8s_anywhere::*;
|
||||
pub use localhost::*;
|
||||
pub mod k8s;
|
||||
|
||||
@ -11,6 +11,3 @@ pub struct MonitorConfig {
|
||||
pub backend: MonitoringBackendType,
|
||||
pub alert_channels: Vec<Box<dyn AlertChannelConfig>>,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,15 +1,12 @@
|
||||
use async_trait::async_trait;
|
||||
|
||||
use std::fmt::Debug;
|
||||
use dyn_clone::DynClone;
|
||||
use serde_json::Value;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use crate::interpret::InterpretError;
|
||||
|
||||
use crate::{
|
||||
interpret::Outcome,
|
||||
topology::Topology,
|
||||
};
|
||||
use crate::{interpret::Outcome, topology::Topology};
|
||||
|
||||
use super::notification_adapter_deployer::NotificationAdapterDeployer;
|
||||
use super::{MonitorConfig, MonitoringBackendType};
|
||||
@ -43,18 +40,23 @@ pub trait Monitor<T: Topology + NotificationAdapterDeployer> {
|
||||
if let Some(notification_adapter_id) =
|
||||
channel.requires_external_alert_channel_adapter(&monitor_config.backend)
|
||||
{
|
||||
topology.deploy_notification_adapter(
|
||||
¬ification_adapter_id.as_ref(),
|
||||
)?;
|
||||
topology.deploy_notification_adapter(¬ification_adapter_id.as_ref())?;
|
||||
}
|
||||
|
||||
}
|
||||
Ok(Outcome::success(format!("deployed alert channels {:?}", &monitor_config.alert_channels)))
|
||||
Ok(Outcome::success(format!(
|
||||
"deployed alert channels {:?}",
|
||||
&monitor_config.alert_channels
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AlertChannelConfig: Debug + DynClone + Send + Sync {
|
||||
fn build_backend_integration_config(&self, backend: &MonitoringBackendType) -> Result<Value, InterpretError>;
|
||||
fn requires_external_alert_channel_adapter(&self, backend: &MonitoringBackendType) -> Option<String>;
|
||||
fn build_backend_integration_config(
|
||||
&self,
|
||||
backend: &MonitoringBackendType,
|
||||
) -> Result<Value, InterpretError>;
|
||||
fn requires_external_alert_channel_adapter(
|
||||
&self,
|
||||
backend: &MonitoringBackendType,
|
||||
) -> Option<String>;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user