From 7447e133c916baa81455e99c7a2c0599981c90cf Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Wed, 26 Nov 2014 10:22:39 -0800 Subject: [PATCH] validate: promote invalid values to an error --- config/validate/rules.go | 2 +- config/validate/rules_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/validate/rules.go b/config/validate/rules.go index 87f2d08..7651819 100644 --- a/config/validate/rules.go +++ b/config/validate/rules.go @@ -76,7 +76,7 @@ func checkValidity(cfg node, report *Report) { func checkNodeValidity(n, g node, r *Report) { if err := config.AssertValid(n.Value, g.field.Tag.Get("valid")); err != nil { - r.Warning(n.line, fmt.Sprintf("invalid value %v", n.Value)) + r.Error(n.line, fmt.Sprintf("invalid value %v", n.Value)) } switch g.Kind() { case reflect.Struct: diff --git a/config/validate/rules_test.go b/config/validate/rules_test.go index e3ec1f6..ab6d157 100644 --- a/config/validate/rules_test.go +++ b/config/validate/rules_test.go @@ -218,7 +218,7 @@ func TestCheckValidity(t *testing.T) { }, { config: "coreos:\n units:\n - command: lol", - entries: []Entry{{entryWarning, "invalid value lol", 3}}, + entries: []Entry{{entryError, "invalid value lol", 3}}, }, // struct @@ -227,7 +227,7 @@ func TestCheckValidity(t *testing.T) { }, { config: "coreos:\n update:\n reboot_strategy: always", - entries: []Entry{{entryWarning, "invalid value always", 3}}, + entries: []Entry{{entryError, "invalid value always", 3}}, }, // unknown