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

Rework logic when there are no alerts defined #66

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Conversation

martialblog
Copy link
Member

I reworked to logic when no alerts are returned from the API.

Changes default to OK, instead of UNKNOWN.

Added a check to see if the API response contains alert rules. If not, we exit early.

To add extra flexibility this also adds a --no-alerts-state flag that can be used to set the desired exit state when no alerts are found.

See #65

@martialblog martialblog added this to the v0.3.0 milestone Dec 16, 2024
@wattebausch
Copy link

Sorry, I wrote my results here
#65 (comment)

Copy link
Member

@RincewindsHat RincewindsHat left a comment

Choose a reason for hiding this comment

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

Small not regarding a variable name.
Apart from that, good to go

cmd/alert.go Outdated Show resolved Hide resolved
Changes default to OK, instead of UNKNOWN.

Added a check to see if the API response contains
alert rules. If not, we exit early.

To add extra flexibility this also adds a --no-alerts-state
flag that can be used to set the desired exit state when no
alerts are found.
@martialblog martialblog merged commit 67fb855 into main Dec 18, 2024
2 checks passed
@martialblog martialblog deleted the no-alerts-logic branch December 18, 2024 17:34
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.

3 participants