diff options
author | Dan Duvall <dduvall@wikimedia.org> | 2018-04-04 15:28:21 -0700 |
---|---|---|
committer | Dan Duvall <dduvall@wikimedia.org> | 2018-04-05 13:24:01 -0700 |
commit | 26b998456a566989e054f18f5dc8934fa3fc904d (patch) | |
tree | bab51963a654987b572cb22c6ef9f33753049fa5 /blubber.example.yaml | |
parent | 73ee493d6e54ed097edfad2a8d782584a6035cea (diff) | |
download | blubber-26b998456a566989e054f18f5dc8934fa3fc904d.tar.gz |
Introduce strict/versioned config parsing
Summary:
Introduced a `version` config field that must be specified and match
`config.CurrentVersion`.
Changed `config.ReadConfig` to use `yaml.UnmarshalStrict` to ensure that
errors are surfaced when unknown/bad fields are present in the given
YAML config. A smaller `config.VersionConfig` is now unmarshaled first
to prevalidate the new `version` field before the entire config is
parsed.
Fixes T191460
Test Plan:
Run `go test ./...`. Run `blubber` against some configuration containing
invalid fields and ensure that it surfaces a YAML error.
Reviewers: thcipriani, demon, hashar, mmodell, mobrovac, #release-engineering-team
Reviewed By: thcipriani, #release-engineering-team
Tags: #release-engineering-team
Maniphest Tasks: T191460
Differential Revision: https://phabricator.wikimedia.org/D1021
Diffstat (limited to 'blubber.example.yaml')
-rw-r--r-- | blubber.example.yaml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/blubber.example.yaml b/blubber.example.yaml index e47eefb..e4fe3c9 100644 --- a/blubber.example.yaml +++ b/blubber.example.yaml @@ -1,4 +1,5 @@ --- +version: v1 base: debian:jessie apt: packages: [libjpeg, libyaml] |