mirror of
https://github.com/prometheus/prometheus
synced 2025-03-05 13:08:30 +00:00
config: Fix overflow checking in global config (#2783)
This commit is contained in:
parent
e0f046396a
commit
240bb671e2
@ -380,7 +380,7 @@ func (c *GlobalConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
if err := unmarshal((*plain)(gc)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := checkOverflow(c.XXX, "global config"); err != nil {
|
||||
if err := checkOverflow(gc.XXX, "global config"); err != nil {
|
||||
return err
|
||||
}
|
||||
// First set the correct scrape interval, then check that the timeout
|
||||
|
@ -639,6 +639,9 @@ var expectedErrors = []struct {
|
||||
}, {
|
||||
filename: "target_label_hashmod_missing.bad.yml",
|
||||
errMsg: "relabel configuration for hashmod action requires 'target_label' value",
|
||||
}, {
|
||||
filename: "unknown_global_attr.bad.yml",
|
||||
errMsg: "unknown fields in global config: nonexistent_field",
|
||||
},
|
||||
}
|
||||
|
||||
|
2
config/testdata/unknown_global_attr.bad.yml
vendored
Normal file
2
config/testdata/unknown_global_attr.bad.yml
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
global:
|
||||
nonexistent_field: test
|
Loading…
Reference in New Issue
Block a user