From 47f1622d7f39bc9e40890e42cd3fdfcc3e22a931 Mon Sep 17 00:00:00 2001 From: Moshe Immermam Date: Fri, 8 Nov 2024 15:09:49 +0200 Subject: [PATCH] fix: notification silence validation --- notification/silence.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notification/silence.go b/notification/silence.go index 45486900..6d201732 100644 --- a/notification/silence.go +++ b/notification/silence.go @@ -50,8 +50,8 @@ func (t *SilenceSaveRequest) Validate() error { return errors.New("`from` time must be before `until") } - if t.NotificationSilenceResource.Empty() { - return errors.New("at least one of `config_id`, `canary_id`, `check_id` or `component_id` is required") + if t.NotificationSilenceResource.Empty() && t.Filter == "" { + return errors.New("at least one of config_id, canary_id, check_id, component_id, filter is required") } return nil