Alerting: Prohibit receivers with empty name (#113064)
This commit is contained in:
@@ -130,6 +130,9 @@ func (r *Receiver) WithExistingSecureFields(existing *Receiver, integrationSecur
|
||||
// Validate validates all integration settings, ensuring that the integrations are correctly configured.
|
||||
func (r *Receiver) Validate(decryptFn DecryptFn) error {
|
||||
var errs []error
|
||||
if r.Name == "" {
|
||||
errs = append(errs, fmt.Errorf("name should not be an empty string"))
|
||||
}
|
||||
for _, integration := range r.Integrations {
|
||||
if err := integration.Validate(decryptFn); err != nil {
|
||||
errs = append(errs, err)
|
||||
|
||||
Reference in New Issue
Block a user