mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +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)
|
||||
}
|
||||
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 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)
|
||||
}
|
||||
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 stcs, nil
|
||||
|
|
Loading…
Reference in a new issue