diff --git a/discovery/azure/azure.go b/discovery/azure/azure.go index 2edaa2d9e..c7119f948 100644 --- a/discovery/azure/azure.go +++ b/discovery/azure/azure.go @@ -86,6 +86,9 @@ func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { if err != nil { return err } + if c.SubscriptionID == "" { + return fmt.Errorf("Azure SD configuration requires a subscription_id") + } return yaml_util.CheckOverflow(c.XXX, "azure_sd_config") } diff --git a/discovery/openstack/openstack.go b/discovery/openstack/openstack.go index 85a6aff10..ac7371db9 100644 --- a/discovery/openstack/openstack.go +++ b/discovery/openstack/openstack.go @@ -103,6 +103,9 @@ func (c *SDConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { if c.Role == "" { return fmt.Errorf("role missing (one of: instance, hypervisor)") } + if c.Region == "" { + return fmt.Errorf("Openstack SD configuration requires a region") + } return yaml_util.CheckOverflow(c.XXX, "openstack_sd_config") }