config: change valid tag to use regexp

A regular expression is much more useful than a list of strings.
This commit is contained in:
Alex Crawford
2014-12-20 23:26:05 -08:00
parent 40d943fb7a
commit af8e590575
9 changed files with 186 additions and 21 deletions

View File

@@ -100,7 +100,7 @@ func TestUpdateFile(t *testing.T) {
},
{
config: config.Update{RebootStrategy: "wizzlewazzle"},
err: &config.ErrorValid{Value: "wizzlewazzle", Field: "RebootStrategy", Valid: []string{"best-effort", "etcd-lock", "reboot", "off"}},
err: &config.ErrorValid{Value: "wizzlewazzle", Field: "RebootStrategy", Valid: "^(best-effort|etcd-lock|reboot|off)$"},
},
{
config: config.Update{Group: "master", Server: "http://foo.com"},