feat: added the steps to install discord-webhook-receiver for k8s anywhere topology if not already installed #50
| @ -130,50 +130,15 @@ struct DiscordWebhookReceiverScore { | |||||||
| 
 | 
 | ||||||
| impl<T: Topology + HelmCommand> Score<T> for DiscordWebhookReceiverScore { | impl<T: Topology + HelmCommand> Score<T> for DiscordWebhookReceiverScore { | ||||||
|     fn create_interpret(&self) -> Box<dyn Interpret<T>> { |     fn create_interpret(&self) -> Box<dyn Interpret<T>> { | ||||||
|         Box::new(DiscordWebhookReceiverScoreInterpret { |  | ||||||
|             config: self.config.clone(), |  | ||||||
|         }) |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     fn name(&self) -> String { |  | ||||||
|         "DiscordWebhookReceiverScore".to_string() |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| #[derive(Debug)] |  | ||||||
| struct DiscordWebhookReceiverScoreInterpret { |  | ||||||
|     config: DiscordWebhookConfig, |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| #[async_trait] |  | ||||||
| impl<T: Topology + HelmCommand> Interpret<T> for DiscordWebhookReceiverScoreInterpret { |  | ||||||
|     async fn execute( |  | ||||||
|         &self, |  | ||||||
|         inventory: &Inventory, |  | ||||||
|         topology: &T, |  | ||||||
|     ) -> Result<Outcome, InterpretError> { |  | ||||||
|         discord_alert_manager_score( |         discord_alert_manager_score( | ||||||
|             self.config.webhook_url.clone(), |             self.config.webhook_url.clone(), | ||||||
|             self.config.name.clone(), |             self.config.name.clone(), | ||||||
|             self.config.name.clone(), |             self.config.name.clone(), | ||||||
|         ) |         ) | ||||||
|         .create_interpret() |         .create_interpret() | ||||||
|         .execute(inventory, topology) |  | ||||||
|         .await |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     fn get_name(&self) -> InterpretName { |     fn name(&self) -> String { | ||||||
|         todo!() |         "DiscordWebhookReceiverScore".to_string() | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     fn get_version(&self) -> Version { |  | ||||||
|         todo!() |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     fn get_status(&self) -> InterpretStatus { |  | ||||||
|         todo!() |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     fn get_children(&self) -> Vec<Id> { |  | ||||||
|         todo!() |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user