From 6da680c7e48f4a7569ed209ba674b9287822ed2b Mon Sep 17 00:00:00 2001 From: johncming Date: Sun, 19 Jul 2020 21:56:23 +0800 Subject: [PATCH] discovery/config: add swarmsd config validation. Signed-off-by: johncming --- discovery/config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discovery/config/config.go b/discovery/config/config.go index cf7b7e9e3..b21777c17 100644 --- a/discovery/config/config.go +++ b/discovery/config/config.go @@ -83,6 +83,11 @@ func (c *ServiceDiscoveryConfig) Validate() error { return errors.New("empty or null section in digitalocean_sd_configs") } } + for _, cfg := range c.DockerSwarmSDConfigs { + if cfg == nil { + return errors.New("empty or null section in dockerswarm_sd_configs") + } + } for _, cfg := range c.DNSSDConfigs { if cfg == nil { return errors.New("empty or null section in dns_sd_configs")