Skip to content

Commit

Permalink
markups: Add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
lmm committed Jun 10, 2020
1 parent 179ddea commit 4c46c87
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/validator/v3/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,21 @@ func init() {
},
}, false,
),
Entry("disallow global() in EntityRule selector field",
&api.GlobalNetworkPolicy{
ObjectMeta: v1.ObjectMeta{Name: "thing"},
Spec: api.GlobalNetworkPolicySpec{
Ingress: []api.Rule{
{
Action: "Allow",
Source: api.EntityRule{
Selector: "global()",
},
},
},
},
}, false,
),
Entry("allow global() in EntityRule namespaceSelector field",
&api.GlobalNetworkPolicy{
ObjectMeta: v1.ObjectMeta{Name: "thing"},
Expand All @@ -1668,6 +1683,9 @@ func init() {
Source: api.EntityRule{
NamespaceSelector: "global()",
},
Destination: api.EntityRule{
NamespaceSelector: "global()",
},
},
},
},
Expand Down

0 comments on commit 4c46c87

Please sign in to comment.