Merge pull request #7615 from johncming/swarmsd_config

discovery/config: add swarmsd config validation.
This commit is contained in:
Björn Rabenstein 2020-07-20 11:56:00 +02:00 committed by GitHub
commit e0c0f996b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")