mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-21 15:45:01 +00:00
app/vmagent: do not allow non-supported fields in -remoteWrite.relabelConfig
and file_sd_configs
This should reduce possible confusion like in the https://github.com/VictoriaMetrics/VictoriaMetrics/issues/363
This commit is contained in:
parent
47e986c26f
commit
12789a4621
2 changed files with 2 additions and 2 deletions
|
@ -28,7 +28,7 @@ func LoadRelabelConfigs(path string) ([]ParsedRelabelConfig, error) {
|
||||||
return nil, fmt.Errorf("cannot read `relabel_configs` from %q: %s", path, err)
|
return nil, fmt.Errorf("cannot read `relabel_configs` from %q: %s", path, err)
|
||||||
}
|
}
|
||||||
var rcs []RelabelConfig
|
var rcs []RelabelConfig
|
||||||
if err := yaml.Unmarshal(data, &rcs); err != nil {
|
if err := yaml.UnmarshalStrict(data, &rcs); err != nil {
|
||||||
return nil, fmt.Errorf("cannot unmarshal `relabel_configs` from %q: %s", path, err)
|
return nil, fmt.Errorf("cannot unmarshal `relabel_configs` from %q: %s", path, err)
|
||||||
}
|
}
|
||||||
return ParseRelabelConfigs(nil, rcs)
|
return ParseRelabelConfigs(nil, rcs)
|
||||||
|
|
|
@ -102,7 +102,7 @@ func loadStaticConfigs(path string) ([]StaticConfig, error) {
|
||||||
return nil, fmt.Errorf("cannot read `static_configs` from %q: %s", path, err)
|
return nil, fmt.Errorf("cannot read `static_configs` from %q: %s", path, err)
|
||||||
}
|
}
|
||||||
var stcs []StaticConfig
|
var stcs []StaticConfig
|
||||||
if err := yaml.Unmarshal(data, &stcs); err != nil {
|
if err := yaml.UnmarshalStrict(data, &stcs); err != nil {
|
||||||
return nil, fmt.Errorf("cannot unmarshal `static_configs` from %q: %s", path, err)
|
return nil, fmt.Errorf("cannot unmarshal `static_configs` from %q: %s", path, err)
|
||||||
}
|
}
|
||||||
return stcs, nil
|
return stcs, nil
|
||||||
|
|
Loading…
Reference in a new issue