-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
AlertmanagerConfig validation for opsgenie_config.responder.type does not allow template strings #4882
Labels
Comments
good catch! would you like to submit a fix? |
hmm in fact the Alertmanager documentation isn't accurate because the config validation only accepts |
This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions. |
Depends on prometheus/alertmanager#3060 |
/assign |
yp969803
added a commit
to yp969803/prometheus-operator
that referenced
this issue
Mar 8, 2024
5 tasks
yp969803
added a commit
to yp969803/prometheus-operator
that referenced
this issue
Apr 8, 2024
…r#4882) rfac: OpsGenieConfigResponder Validation chore: unit tests added
yp969803
added a commit
to yp969803/prometheus-operator
that referenced
this issue
Apr 8, 2024
…r#4882) rfac: OpsGenieConfigResponder Validation chore: unit tests added rfac: alertmanagerCfg unit test
simonpasquier
added a commit
that referenced
this issue
May 6, 2024
chore: Template string allowed for Responder.Type (#4882)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
According to the Alertmanager documentation a
<tmpl_string>
should be accepted as value foropsgenie_config.responder.type
.Prometheus Operator refuses to accept a template string (see log output below).
Did you expect to see something different?
I expect a
tmpl_string
, i.e. a string containing valid go-template code, to be accepted as value for fieldresponder.type
.This
tmpl_string
must evaluate to ^(team|teams|user|escalation|schedule)$ – but only after template evaluation and not to be valid alertmanager configuration.Currently this prevents to have it evaluated during alert routing and to dynamically assign responders type (just like name, id, username) according to alert label values.
How to reproduce it (as minimally and precisely as possible):
Try to apply alertmanager config with a responder type as in the manifest snippet below (or any other template string).
Environment
Prometheus Operator version:
quay.io/prometheus-operator/prometheus-operator:v0.56.3
Kubernetes version information:
v1.21.5
Kubernetes cluster kind:
plain vanilla kubespray cluster
Manifests:
kube-prometheus-stack helm values:
Anything else we need to know?:
Problematic validation on string enum was probably introduced here:
d8454e4
The text was updated successfully, but these errors were encountered: