Feat: Add validations for PagerDuty Receiver in Alertmanager Config CR#8113
Conversation
| // url defines the URL to send requests to. | ||
| // +optional | ||
| URL string `json:"url,omitempty"` | ||
| URL URL `json:"url,omitempty"` |
There was a problem hiding this comment.
can we make it a pointer to comply with the API conventions? Same remark for the ClientURL field and the v1beta1 package.
| URL URL `json:"url,omitempty"` | |
| URL *URL `json:"url,omitempty"` |
|
@simonpasquier Updated, please review |
| } | ||
| } | ||
|
|
||
| if config.URL != "" { |
There was a problem hiding this comment.
can we keep the URL validation + add the same for clientURL? The rationale is that the validation webhook might not be deployed and the API validation might not be covering 100% of the edge cases.
There was a problem hiding this comment.
@simonpasquier I can keep but I'm a bit confused about the webhook part. I don't think the previous code calls admission webhook. L#1100 just refer to the validationv1alpha1 package only.
Correct me if I'm wrong.
There was a problem hiding this comment.
Sorry my bad, I agre that we can indeed remove the check here because it's now covered in validationv1alpha1.ValidateAlertmanagerConfig() which shoud be called when the controller selects AlertmanagerConfig resources.
There was a problem hiding this comment.
@simonpasquier Updated already. Pls review.
|
@simonpasquier Updated, pls review. |
|
@simonpasquier Can help review pls? |
|
@simonpasquier Updated as you suggested. Pls review |
to fix merge conflicts
|
Move to draft and wait for #8211 to merge first. |
…alidation to have stricter validation
to fix merge conflicts
to use the new method validatURLPtr
|
@simonpasquier Could you please review this PR? |
to cover more cases
Description
This PR adds validations to PagerDuty config CR by
Type of change
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 Testing
Changelog entry