update error message for invalid policy

This commit is contained in:
Chelsea Holland Komlo
2017-10-17 12:21:38 -04:00
parent 429586d703
commit 7453b2c8ff
2 changed files with 2 additions and 2 deletions

View File

@@ -137,7 +137,7 @@ func Parse(rules string) (*Policy, error) {
// At least one valid policy must be specified, we don't want to store only
// raw data
if len(p.Namespaces) < 1 && p.Agent == nil && p.Node == nil && p.Operator == nil && p.Quota == nil {
return nil, fmt.Errorf("Invalid rule set due to missing namespace name: %s", p.Raw)
return nil, fmt.Errorf("Invalid policy: %s", p.Raw)
}
// Validate the policy

View File

@@ -166,7 +166,7 @@ func TestParse(t *testing.T) {
"Rules": "anything"
}
`,
"Invalid rule set due to missing namespace name",
"Invalid policy",
nil,
},
{