mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-24 04:02:04 -08:00
config: add test for OpenStack SD (#4594)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
05726c5ea2
commit
128ff546b8
|
@ -695,6 +695,9 @@ var expectedErrors = []struct {
|
||||||
}, {
|
}, {
|
||||||
filename: "marathon_authtoken_bearertoken.bad.yml",
|
filename: "marathon_authtoken_bearertoken.bad.yml",
|
||||||
errMsg: "marathon_sd: at most one of bearer_token, bearer_token_file, auth_token & auth_token_file must be configured",
|
errMsg: "marathon_sd: at most one of bearer_token, bearer_token_file, auth_token & auth_token_file must be configured",
|
||||||
|
}, {
|
||||||
|
filename: "openstack_role.bad.yml",
|
||||||
|
errMsg: "unknown OpenStack SD role",
|
||||||
}, {
|
}, {
|
||||||
filename: "url_in_targetgroup.bad.yml",
|
filename: "url_in_targetgroup.bad.yml",
|
||||||
errMsg: "\"http://bad\" is not a valid hostname",
|
errMsg: "\"http://bad\" is not a valid hostname",
|
||||||
|
|
4
config/testdata/openstack_role.bad.yml
vendored
Normal file
4
config/testdata/openstack_role.bad.yml
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
scrape_configs:
|
||||||
|
- openstack_sd_configs:
|
||||||
|
- role: invalid
|
||||||
|
|
|
@ -84,7 +84,7 @@ func (c *Role) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
case OpenStackRoleHypervisor, OpenStackRoleInstance:
|
case OpenStackRoleHypervisor, OpenStackRoleInstance:
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("Unknown OpenStack SD role %q", *c)
|
return fmt.Errorf("unknown OpenStack SD role %q", *c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue