vmlertmanagerconfig: make optional route and receivers#1805
Closed
AndrewChubatiuk wants to merge 2 commits intomasterfrom
Closed
vmlertmanagerconfig: make optional route and receivers#1805AndrewChubatiuk wants to merge 2 commits intomasterfrom
AndrewChubatiuk wants to merge 2 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 9 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="api/operator/v1beta1/vmalertmanagerconfig_types.go">
<violation number="1" location="api/operator/v1beta1/vmalertmanagerconfig_types.go:133">
P2: Root routes without a receiver now pass validation, but Alertmanager requires a default receiver on the root route. This can lead to config rejection at runtime. Enforce a non-empty root receiver when Route is provided.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
9f78b42 to
339425c
Compare
vrutkovs
reviewed
Feb 17, 2026
|
|
||
| // ConvertAlertmanagerConfig creates VMAlertmanagerConfig from prometheus alertmanagerConfig | ||
| func ConvertAlertmanagerConfig(promAMCfg *promv1alpha1.AlertmanagerConfig, conf *config.BaseOperatorConf) (*vmv1beta1.VMAlertmanagerConfig, error) { | ||
| convertedRoute, err := convertPromRoute(promAMCfg.Spec.Route) |
Collaborator
There was a problem hiding this comment.
convertPromRoute returns nil, nil when Route is unset, but VMAlertmanagerConfigSpec later requires a valid Route.
I think we should throw an error here / update convertPromRoute
Contributor
Author
There was a problem hiding this comment.
route should be valid only if it exists, unset route is allowed
e92da2c to
0017fb7
Compare
0017fb7 to
81a885b
Compare
vrutkovs
reviewed
Feb 18, 2026
Collaborator
There was a problem hiding this comment.
Suggested change
| func isSTSPod(pod *corev1.Pod) bool { | |
| func isOwnedBySTS(pod *corev1.Pod) bool { |
| return false | ||
| } | ||
|
|
||
| func filterSTSPods(pods []corev1.Pod, revision string, minReadySeconds int32, recreate bool) ([]corev1.Pod, []corev1.Pod, []corev1.Pod) { |
Collaborator
There was a problem hiding this comment.
Lets add a few unit tests here - I'm concerned about some pods ending up on both readyPods and podsForUpdate list, which would break the expected total calculation
8497186 to
2fa4b84
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1800
additionally fixed removed deletionTimestamp check from PodIsready function. Execution of this function should be skipped in case of pod which is being deleted
Summary by cubic
Make VMAlertmanagerConfig.spec.route and .receivers optional to support minimal configs (e.g., only inhibition rules) and align with Prometheus Operator. Improves rollout/readiness by skipping terminating pods, filtering to StatefulSet-owned pods, and hardening waitForPodReady; fixes #1800.
Written for commit 2fa4b84. Summary will update on new commits.