From 47b8cdf692df51143a1401cc5f7e110f00d8892d Mon Sep 17 00:00:00 2001 From: Romain Beuque Date: Tue, 3 Mar 2020 17:07:25 +0100 Subject: [PATCH] fix: notify pluggins can have no backends (fixes regression introduced by #51) (#83) NotifyBackends can be empty ( as https://github.com/ovh/utask/blob/master/pkg/notify/notify.go#L51 ) Signed-off-by: Romain Beuque --- pkg/plugins/builtin/notify/notify.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/plugins/builtin/notify/notify.go b/pkg/plugins/builtin/notify/notify.go index 7886e499..5a3697eb 100644 --- a/pkg/plugins/builtin/notify/notify.go +++ b/pkg/plugins/builtin/notify/notify.go @@ -1,7 +1,6 @@ package notify import ( - "errors" "fmt" "sort" "strings" @@ -35,7 +34,8 @@ func validConfig(config interface{}) error { cfg := config.(*Config) if len(cfg.Backends) == 0 { - return errors.New("backends field can't be empty") + // if no backends defined, implies that all backends will be contacted + return nil } snames := notify.ListSendersNames()