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

Fix: NotificationPolicy LoopDetected condition and route.receiver validation #1843

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Baarsgaard
Copy link
Contributor

@Baarsgaard Baarsgaard commented Jan 30, 2025

While working on #1837 on I was unable to provoke the LoopDetected status and discovered that it was removed immediately after being set, the detection itself seems to work without issues.
The above resulted in loops being detected, dynamic routes being ignored and an ApplySucceeded condition on GrafanaNotificationPolicy CRs
This means that previously working NotificationPolicy trees with dynamic routes would be overwritten with only the static routes in the main GrafanaNotificationPolicy, if any.

This changes the behaviour from applying only static routes and ignoring everything dynamic to refusing updates entirely.
LoopDetected is now before fetching instances resulting in it having higher priority.
InvalidSpec is an error and the NoMatchingInstances is not.

receiver is now a required field due to the current implementation always returning 400 BAD REQUEST when trying to apply a route when the receiver is omitted.
Lastly, the grafana-operator category was missing from the GrafanaNotificationPolicyRoute

chore: NotificationPolicyRoute missing category
chore: Move InvalidSpec loopDetection above Grafana instance fetching
@github-actions github-actions bot added documentation Issues relating to documentation, missing, non-clear etc. bugfix this PR fixes a bug labels Jan 30, 2025
@Baarsgaard Baarsgaard marked this pull request as ready for review January 31, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix this PR fixes a bug documentation Issues relating to documentation, missing, non-clear etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant