Alerting: Prevent simplified routing zero duration GroupInterval and RepeatInterval (#86561)

Prevent zero duration GroupInterval and RepeatInterval
This commit is contained in:
Matthew Jacobson
2024-04-18 21:08:38 -04:00
committed by GitHub
parent 71445002b7
commit a20197229e
2 changed files with 14 additions and 4 deletions
+4 -4
View File
@@ -81,11 +81,11 @@ func (s *NotificationSettings) Validate() error {
if s.GroupWait != nil && *s.GroupWait < 0 {
return errors.New("group wait must be a positive duration")
}
if s.GroupInterval != nil && *s.GroupInterval < 0 {
return errors.New("group interval must be a positive duration")
if s.GroupInterval != nil && *s.GroupInterval <= 0 {
return errors.New("group interval must be greater than zero")
}
if s.RepeatInterval != nil && *s.RepeatInterval < 0 {
return errors.New("repeat interval must be a positive duration")
if s.RepeatInterval != nil && *s.RepeatInterval <= 0 {
return errors.New("repeat interval must be greater than zero")
}
return nil
}