mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01: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
c386c5de57
commit
986dba5ab3
@ -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 New Issue
Block a user