From 1ec7809eaff11951164f62e3a9f80934a70932bf Mon Sep 17 00:00:00 2001 From: Tanner Bruce Date: Thu, 9 Aug 2018 16:30:06 -0500 Subject: [PATCH] use strict unmarshalling to ensure correct configuration --- pkg/config/loader.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/config/loader.go b/pkg/config/loader.go index ecc36a23..64af92ba 100644 --- a/pkg/config/loader.go +++ b/pkg/config/loader.go @@ -25,7 +25,7 @@ func FromFile(filename string) (*MetricsDiscoveryConfig, error) { // FromYAML loads the configuration from a blob of YAML. func FromYAML(contents []byte) (*MetricsDiscoveryConfig, error) { var cfg MetricsDiscoveryConfig - if err := yaml.Unmarshal(contents, &cfg); err != nil { + if err := yaml.UnmarshalStrict(contents, &cfg); err != nil { return nil, fmt.Errorf("unable to parse metrics discovery config: %v", err) } return &cfg, nil