feat: added the steps to install discord-webhook-receiver for k8s anywhere topology if not already installed #50

Closed
wjro wants to merge 6 commits from feat/discord-webhook-receiver into master
Owner
No description provided.
wjro added 1 commit 2025-06-03 18:19:19 +00:00
feat: added the steps to install discord-webhook-receiver for k8s anywhere topology if not already installed
All checks were successful
Run Check Script / check (push) Successful in 1m45s
Run Check Script / check (pull_request) Successful in 1m48s
2ca732cecd
wjro added 1 commit 2025-06-03 20:07:29 +00:00
fix: Ensure idempotent deployment of Discord adapters
All checks were successful
Run Check Script / check (push) Successful in 1m49s
Run Check Script / check (pull_request) Successful in 1m46s
cd40660350
Updates  to use  for managing
Discord webhook adapter deployments. This prevents redundant installations
by ensuring that the deployment interpret for a given adapter
configuration is executed only once.

The internal state now uses a  keyed by the alertreceiver ID to
track and initialize each receiver's .
johnride requested changes 2025-06-04 18:41:38 +00:00
johnride left a comment
Owner

Does this even work? I don't see the binding with the ensure_ready impementation of K8sAnywhere.

Overall this needs more clarity and better following Harmony's standards.

Does this even work? I don't see the binding with the ensure_ready impementation of K8sAnywhere. Overall this needs more clarity and better following Harmony's standards.
@ -41,3 +50,3 @@
#[async_trait]
impl DiscordWebhookReceiver for K8sAnywhereTopology {
fn deploy_discord_webhook_receiver(
async fn deploy_discord_webhook_receiver(
Owner

This should not be called deploy as this will not deploy every time it is called. We use "ensure" for this behavior.

This should not be called deploy as this will not deploy every time it is called. We use "ensure" for this behavior.
johnride marked this conversation as resolved
@ -54,2 +87,4 @@
}
}
async fn initialize_discord_webhook_receiver(
Owner

This function looks really weird, I feel like this is a hack to link the config and the dependency together.

The need to link them makes sense, I guess the webhook sender needs to know the webhook config when it is being deployed. But I am sure there can be a cleaner way than this.

This function looks really weird, I feel like this is a hack to link the config and the dependency together. The need to link them makes sense, I guess the webhook sender needs to know the webhook config when it is being deployed. But I am sure there can be a cleaner way than this.
johnride marked this conversation as resolved
@ -56,0 +98,4 @@
let score = DiscordWebhookReceiverScore {
config: conf.clone(),
};
let inventory = Inventory::autoload();
Owner

autoloading inventory here is a big smell, you should avoid this as much as possible. What if the used built a custom Inventory and now you're autoloading his production inventory and you start wiping operating systems and network configurations?

Always use the inventory that is passed down from the main Maestro.

autoloading inventory here is a big smell, you should avoid this as much as possible. What if the used built a custom Inventory and now you're autoloading his production inventory and you start wiping operating systems and network configurations? Always use the inventory that is passed down from the main Maestro.
johnride marked this conversation as resolved
@ -56,0 +136,4 @@
inventory: &Inventory,
topology: &T,
) -> Result<Outcome, InterpretError> {
discord_alert_manager_score(
Owner

It's a bit weird to use a public raw function like this to initialize a Score, why not just use the usual struct building method?

It's a bit weird to use a public raw function like this to initialize a Score, why not just use the usual struct building method?
johnride marked this conversation as resolved
wjro added 1 commit 2025-06-04 19:48:03 +00:00
fix:binding with the ensure_ready impementation of K8sAnywhe
Some checks failed
Run Check Script / check (push) Failing after 45s
Run Check Script / check (pull_request) Failing after 43s
ea4709a409
wjro added 1 commit 2025-06-04 19:52:42 +00:00
fix: cargo fmt
All checks were successful
Run Check Script / check (push) Successful in 1m48s
Run Check Script / check (pull_request) Successful in 1m47s
b33650e9d5
wjro added 1 commit 2025-06-04 20:15:47 +00:00
fix: removed unnecessary DiscordWebhookRecevierInerpret and its impl
All checks were successful
Run Check Script / check (push) Successful in 1m47s
Run Check Script / check (pull_request) Successful in 1m47s
dda8e29843
wjro added 1 commit 2025-06-05 18:04:24 +00:00
fix: modified discordwebhookreceiver to use a generic initialize_alert_receiver function from k8sanywhere topology
All checks were successful
Run Check Script / check (push) Successful in 1m47s
Run Check Script / check (pull_request) Successful in 1m47s
b5b77cf1ac
Owner

Well well well... https://promlabs.com/blog/2022/12/23/sending-prometheus-alerts-to-discord-with-alertmanager-v0-25-0/

On n'a plus besoin de discord alert manager maintenant. Ça simplifie énormément la chose!

Well well well... https://promlabs.com/blog/2022/12/23/sending-prometheus-alerts-to-discord-with-alertmanager-v0-25-0/ On n'a plus besoin de discord alert manager maintenant. Ça simplifie énormément la chose!
johnride closed this pull request 2025-06-10 13:27:11 +00:00
All checks were successful
Run Check Script / check (push) Successful in 1m47s
Run Check Script / check (pull_request) Successful in 1m47s

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: NationTech/harmony#50
No description provided.