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 ttl
obj to alertmanagercfgs resource
#6515
base: main
Are you sure you want to change the base?
Add ttl
obj to alertmanagercfgs resource
#6515
Conversation
a08a0a7
to
2747edb
Compare
Change looks good here but I'm not a member of this org, so probably better to leave the review up to someone who is. |
@slashpai any review will be great. |
e29c30c
to
036ba68
Compare
Co-authored-by: Nicolas Takashi <nicolas.tcs@hotmail.com>
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.
You also need to push the TTL value to the generated config in here
prometheus-operator/pkg/alertmanager/amcfg.go
Line 1114 in 5b880a0
func (cb *configBuilder) convertPushoverConfig(ctx context.Context, in monitoringv1alpha1.PushoverConfig, crKey types.NamespacedName) (*pushoverConfig, error) { |
@@ -11,6 +11,11 @@ require ( | |||
sigs.k8s.io/controller-runtime v0.17.2 | |||
) | |||
|
|||
require ( | |||
github.com/prometheus/client_model v0.6.0 // indirect |
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.
we shouldn't depend on prometheus/client_model.
@@ -808,6 +809,9 @@ type PushoverConfig struct { | |||
// A title for supplementary URL, otherwise just the URL is shown | |||
// +optional | |||
URLTitle string `json:"urlTitle,omitempty"` | |||
// The time to live definition for the alert notification | |||
// +optional | |||
TTL *model.Duration `json:"ttl,omitempty"` |
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.
you want v1.Duration (though I see that the pushover duration is a custom type in Alertmanager code, not sure why).
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 see that the pushover duration is a custom type in Alertmanager code
sorry, where? any pointer
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 was referring to https://github.com/prometheus/alertmanager/blob/91a94f00f987048fa4f42856165d49370a3af568/config/notifiers.go#L705
But I notice that we're not 100% compliant with the other Pushover duration fields. We can fix them later but for ttl
it would be better to use the existing v1.Duration
type.
Description
Added
ttl
object to alertmanagerConfig resource after time to live introduction on pushoverConfigCloses: #6360
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
x
in the box that apply.CHANGE
(fix or feature that would cause existing functionality to not work as expected)FEATURE
(non-breaking change which adds functionality)BUGFIX
(non-breaking change which fixes an issue)ENHANCEMENT
(non-breaking change which improves existing functionality)NONE
(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.
Changelog entry
Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.