Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event metadata field to Alert spec #519

Merged
merged 1 commit into from
May 12, 2023

Conversation

matheuscscp
Copy link
Member

Fixes #511

@ghost
Copy link

ghost commented May 10, 2023

@stefanprodan Here's the PR for what we just chatted about.

@matheuscscp matheuscscp force-pushed the spec-metadata branch 3 times, most recently from e4e59da to 6ff10d4 Compare May 10, 2023 13:30
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @matheuscscp 🏅

@stefanprodan stefanprodan added enhancement New feature or request area/alerting Alerting related issues and PRs labels May 12, 2023
@stefanprodan stefanprodan merged commit 81be272 into fluxcd:main May 12, 2023
@matheuscscp matheuscscp deleted the spec-metadata branch May 12, 2023 07:35
Comment on lines +54 to +56
// controller. Metadata fields added by the controller have priority over the fields
// added here, and the fields added here have priority over fields originally present
// in the event.
Copy link
Contributor

@darkowlzz darkowlzz May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need some help in clarifying my confusion about this statement.

Metadata fields added by the controller

Who is the controller being referred here? Is the controller notification-controller itself or the other controllers that sends event?
Giving this a try, by setting a metadata "revision": "20" in Alert .spec.eventMetadata and sending an event to the event server with metadata "source.toolkit.fluxcd.io/revision": "10", the outgoing notification seems to have "revision":"20".
So, .spec.eventMetadata has priority over everything else. Which leaves me confused about who is the controller mentioned here that has the highest priority?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After going through the PR, I have the same confusion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you guys are right, i'm walking right now and will reply in a few minutes 👌

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the controller mentioned here which has priority over everything else is notification-controller. when the event arrives at notification-controller, first the metadata is cleaned up, then the eventMetadata field from the Alert spec is added, and then finally the summary field from the Alert spec is added (the only one at the moment). the priority is given by this order.

i will file a PR to improve this explanation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed #528 for improving this doc. I hope it's clear now 👌 thanks for catching that! it was indeed not very well worded 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/alerting Alerting related issues and PRs enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Add field to Alert CRD for adding metadata to the event
4 participants