Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
must one of -> must be one of
Browse files Browse the repository at this point in the history
  • Loading branch information
josephlewis42 committed Jan 16, 2019
1 parent 133e815 commit 469235a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/broker/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (cond Condition) ValidateKeys(allowedKeys []string) error {
return nil
}

return fmt.Errorf("unknown condition keys: %v condition keys must one of: %v, check their capitalization and spelling", invalidKeys, allowedKeys)
return fmt.Errorf("unknown condition keys: %v condition keys must be one of: %v, check their capitalization and spelling", invalidKeys, allowedKeys)
}

// Policy combines a condition with several sets of values that are set if
Expand Down
6 changes: 3 additions & 3 deletions pkg/broker/policy/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestCondition_ValidateKeys(t *testing.T) {
"key-mismatch": {
Condition: Condition{"service_name": "abc"},
AllowedKeys: []string{"service_id"},
Expected: errors.New("unknown condition keys: [service_name] condition keys must one of: [service_id], check their capitalization and spelling"),
Expected: errors.New("unknown condition keys: [service_name] condition keys must be one of: [service_id], check their capitalization and spelling"),
},
}

Expand Down Expand Up @@ -125,7 +125,7 @@ func TestPolicyList_Validate(t *testing.T) {
},
},
AllowedKeys: []string{"a", "b"},
Expected: errors.New(`error in policy[0], comment: "some-user-comment", error: unknown condition keys: [unknown] condition keys must one of: [a b], check their capitalization and spelling`),
Expected: errors.New(`error in policy[0], comment: "some-user-comment", error: unknown condition keys: [unknown] condition keys must be one of: [a b], check their capitalization and spelling`),
},
"bad-assertion": {
Policy: PolicyList{
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestNewPolicyListFromJson(t *testing.T) {
{"//":"user-comment", "if":{"unknown-condition":""}}
]}`,
AllowedKeys: []string{},
Expected: errors.New(`error in policy[0], comment: "user-comment", error: unknown condition keys: [unknown-condition] condition keys must one of: [], check their capitalization and spelling`),
Expected: errors.New(`error in policy[0], comment: "user-comment", error: unknown condition keys: [unknown-condition] condition keys must be one of: [], check their capitalization and spelling`),
},
"bad-assertion": {
Json: `{
Expand Down

0 comments on commit 469235a

Please sign in to comment.