-
Notifications
You must be signed in to change notification settings - Fork 93
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
add initial support for alertmanager external-url #622
Conversation
Just making sure the test fails properly before fixing. |
Hey @bwplotka PTAL |
cc @bernot-dev as this may be relevant to default-off alertmanager/rule-evaluator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Epic, thanks! Some nits, otherwise LGTM. Sorry for review lag.
e2e/alertmanager_test.go
Outdated
})) | ||
t.Run("config set", t.subtest(func(ctx context.Context, t *OperatorContext) { | ||
t.Parallel() | ||
testAlertmanagerConfig(ctx, t, secret, key) | ||
})) | ||
} | ||
|
||
func testAlertmanagerDeployed(ctx context.Context, t *OperatorContext) { | ||
func testAlertmanagerDeployed(ctx context.Context, t *OperatorContext, spec *monitoringv1.ManagedAlertmanagerSpec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func testAlertmanagerDeployed(ctx context.Context, t *OperatorContext, spec *monitoringv1.ManagedAlertmanagerSpec) { | |
func testAlertmanagerDeployed(ctx context.Context, t *OperatorContext, config *monitoringv1.ManagedAlertmanagerSpec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super small nit, but I was quite confused thinking initially this variable as used down there is Alertmanager spec not alertmanager configuration spec (kind of) - a bit more explicitness might help
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure no prob. Changed it to config
.
e2e/alertmanager_test.go
Outdated
} | ||
// We're mainly interested in the dynamic flags but checking the entire set including | ||
// the static ones is ultimately simpler. | ||
if externalURL := spec.ExternalURL; externalURL != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit confused again - can't we prepare wantArgs before looping through Alertmanager statetful set containers? It feel like you do it inside this loop for a reason, but I can't find any 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manifests/setup.yaml
Outdated
@@ -986,6 +986,9 @@ spec: | |||
required: | |||
- key | |||
x-kubernetes-map-type: atomic | |||
externalURL: | |||
type: string | |||
description: ExternalURL is the external URL the managed Alertmanager will be available under. This is used for generating links back to the Alertmanager itself in fired alerts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it wouldn't be easier to put exact flag description. It's essentially more than just alert link, it also fixes UI when reverse proxies are used. WDYT?
description: ExternalURL is the external URL the managed Alertmanager will be available under. This is used for generating links back to the Alertmanager itself in fired alerts. | |
description: The URL under which Alertmanager is externally reachable (for example, if Alertmanager is served via a reverse proxy). Used for generating relative and absolute links back to Alertmanager itself. If the URL has a path portion, it will be used to prefix all HTTP endpoints served by Alertmanager. If omitted, relevant URL components will be derived automatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! Pushed up some fixes
e2e/alertmanager_test.go
Outdated
})) | ||
t.Run("config set", t.subtest(func(ctx context.Context, t *OperatorContext) { | ||
t.Parallel() | ||
testAlertmanagerConfig(ctx, t, secret, key) | ||
})) | ||
} | ||
|
||
func testAlertmanagerDeployed(ctx context.Context, t *OperatorContext) { | ||
func testAlertmanagerDeployed(ctx context.Context, t *OperatorContext, spec *monitoringv1.ManagedAlertmanagerSpec) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure no prob. Changed it to config
.
e2e/alertmanager_test.go
Outdated
} | ||
// We're mainly interested in the dynamic flags but checking the entire set including | ||
// the static ones is ultimately simpler. | ||
if externalURL := spec.ExternalURL; externalURL != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manifests/setup.yaml
Outdated
@@ -986,6 +986,9 @@ spec: | |||
required: | |||
- key | |||
x-kubernetes-map-type: atomic | |||
externalURL: | |||
type: string | |||
description: ExternalURL is the external URL the managed Alertmanager will be available under. This is used for generating links back to the Alertmanager itself in fired alerts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM. Done.
Resolves #352