-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Chore: add WeChat global config secret validation in Alertmanager #7977
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
Chore: add WeChat global config secret validation in Alertmanager #7977
Conversation
pkg/alertmanager/operator.go
Outdated
|
|
||
| func checkAlertmanagerGlobalConfigResource(gc *monitoringv1.AlertmanagerGlobalConfig) error { | ||
| return validationv1.ValidateAlertmanagerGlobalConfig(gc) | ||
| func checkAlertmanagerGlobalConfigResource( |
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.
can we make it a ConfigBuilder method?
| func checkAlertmanagerGlobalConfigResource( | |
| func (cb *ConfigBuidler) checkAlertmanagerGlobalConfigResource( |
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.
@simonpasquier I don't have any opinion against this but just want to understand 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.
Sure (sorry for being dense)! It would avoid passing the store parameter since it's already a field of the ConfigBuilder struct.
|
@simonpasquier Updated. Please have a look. |
pkg/alertmanager/operator.go
Outdated
| return monitoringv1ac.Alertmanager(a.Name, a.Namespace).WithStatus(asac) | ||
| } | ||
|
|
||
| func (cb *ConfigBuilder) checkAlertmanagerGlobalConfigResource( |
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.
(nit) since it's now a ConfigBuilder method, it would be good to move it to amcfg.go next to the other methods.
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.
@simonpasquier Updated
|
@simonpasquier All requested changes have been updated. Please review. |
|
@simonpasquier Anything you can suggest? |
|
@simonpasquier Are you able to have a look? Sorry for repeatedly ping you. |
|
Hi @slashpai , could you please help me review? |
|
Hi, are you able to have a look? @simonpasquier |
|
@simonpasquier any chance you can review this please? |
to cover url validation case
|
@simonpasquier Please review this. Thanks! |
to prevent nil pointer exception
Description
This PR adds global config validation for WeChat in Alertmanager.
The validation checks the secret is presented.
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
xin 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
Unit Test (existing test is already covered)
Changelog entry