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.
can we make it a ConfigBuilder method?
| func checkAlertmanagerGlobalConfigResource( | |
| func (cb *ConfigBuidler) checkAlertmanagerGlobalConfigResource( |
There was a problem hiding this comment.
@simonpasquier I don't have any opinion against this but just want to understand why?
There was a problem hiding this comment.
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.
(nit) since it's now a ConfigBuilder method, it would be good to move it to amcfg.go next to the other methods.
|
@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