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

vmalert: remove notifier null check #813

Merged
merged 4 commits into from
Nov 28, 2023
Merged

Conversation

Haleygo
Copy link
Contributor

@Haleygo Haleygo commented Nov 23, 2023

, since -notifier.url is optional and is needed only if there are alerting rules.

https://new.docs.victoriametrics.com/vmalert/#topology-examples
-notifier.url is optional and is needed only if you have alerting rules.

Also vmalert has -notifier.blackhole flag which supports evaluating alerting rules without sending any notifications to external receivers (eg. alertmanager), see #811.
I think we can leave the check to vmalert itself.

Also, add minor sanity check for vmauth.
If vmauth.Spec.Ingress.TlsSecretName is used, vmauth.Spec.Ingress.TlsHosts is also needed according to the code, otherwise IngressRule will be illegal.

if cr.Spec.Ingress.TlsSecretName != "" {
spec.TLS = []v12.IngressTLS{
{
SecretName: cr.Spec.Ingress.TlsSecretName,
Hosts: cr.Spec.Ingress.TlsHosts,
},
}
for _, host := range cr.Spec.Ingress.TlsHosts {
hostRule := defaultRule.DeepCopy()
hostRule.Host = host
spec.Rules = append(spec.Rules, *hostRule)
}
} else {

@Haleygo Haleygo requested a review from Amper as a code owner November 23, 2023 05:04
@Haleygo Haleygo force-pushed the remove-notifier-url-null-check branch from 262524d to dba641d Compare November 24, 2023 08:27
Copy link
Collaborator

@f41gh7 f41gh7 left a comment

Choose a reason for hiding this comment

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

LGTM

@f41gh7 f41gh7 merged commit 7965dba into master Nov 28, 2023
2 checks passed
@f41gh7 f41gh7 deleted the remove-notifier-url-null-check branch November 28, 2023 17:49
zekker6 added a commit that referenced this pull request Mar 7, 2024
…blackhole is set by user

Previously, setting "notifier.blackhole" and not using any notifiers would lead to CrashLoopBackoff because vmalert would receive an empty "notifier.url" value.

Updates:
- #894
- #813
zekker6 added a commit that referenced this pull request Mar 7, 2024
…blackhole is set by user

Previously, setting "notifier.blackhole" and not using any notifiers would lead to CrashLoopBackoff because vmalert would receive an empty "notifier.url" value.

Updates:
- #894
- #813
f41gh7 pushed a commit that referenced this pull request Mar 7, 2024
…blackhole is set by user

Previously, setting "notifier.blackhole" and not using any notifiers would lead to CrashLoopBackoff because vmalert would receive an empty "notifier.url" value.

Updates:
- #894
- #813
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.

None yet

2 participants