Alerting: Prohibit receivers with empty name (#113064)

This commit is contained in:
Yuri Tseretyan
2025-10-29 16:30:38 -04:00
committed by GitHub
parent f2404361bf
commit a4df6c8bb9
4 changed files with 121 additions and 64 deletions
+3
View File
@@ -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)