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

[RFC-0008] Custom Event Metadata from Annotations #1014

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matheuscscp
Copy link
Member

@matheuscscp matheuscscp commented Dec 24, 2024

Part of: fluxcd/flux2#4809

The most significant change in this PR for implementing RFC 0008 is moving the group prefix removal from the cleanupMetadata() function deeper into the request handling logic, such that the precedence order defined in the RFC can be concisely implemented in a single place. This is because different Alert objects matching an event may append different Alert-level metadata to the event, and hence for the metadata combination, precedence order and key conflict detection to be implemented in a single place, moving the group prefix removal deeper was necessary. This logic is now implemented by the function combineEventMetadata(), which is an evolution of the renamed enhanceEventWithAlertMetadata(). As a result, a few other functions manipulating metadata keys now have to consider the involved object group prefix when doing so.

Tasks:

Comment on lines -171 to +183
app.kubernetes.io/env: "production"
app.kubernetes.io/cluster: "my-cluster"
app.kubernetes.io/region: "us-east-1"
env: production
cluster: my-cluster
region: us-east-1
Copy link
Member Author

@matheuscscp matheuscscp Dec 25, 2024

Choose a reason for hiding this comment

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

I'm removing the app.kubernetes.io/ prefix here since it has little effect and may cause confusion in the presence of other prefixes the user may need to understand for the Alert API, e.g. event.toolkit.fluxcd.io/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant