mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
Fix go vet errors (#2637)
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
parent
ca975b8e99
commit
373420aa6d
1 changed files with 263 additions and 263 deletions
|
@ -16,291 +16,291 @@ func TestEvaluate(t *testing.T) {
|
|||
Result bool
|
||||
}{
|
||||
// Equals
|
||||
{kyverno.Condition{"string", kyverno.Equals, "string"}, true},
|
||||
{kyverno.Condition{1, kyverno.Equals, 1}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.Equals, int64(1)}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.Equals, 1}, true},
|
||||
{kyverno.Condition{1.0, kyverno.Equals, 1.0}, true},
|
||||
{kyverno.Condition{true, kyverno.Equals, true}, true},
|
||||
{kyverno.Condition{false, kyverno.Equals, false}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.Equals, "1Gi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.Equals, "1024Mi"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.Equals, "1h"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.Equals, "60m"}, true},
|
||||
{kyverno.Condition{map[string]interface{}{"foo": "bar"}, kyverno.Equals, map[string]interface{}{"foo": "bar"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"foo", "bar"}, kyverno.Equals, []interface{}{"foo", "bar"}}, true},
|
||||
{kyverno.Condition{[]interface{}{map[string]string{"foo": "bar"}}, kyverno.Equals, []interface{}{map[string]string{"foo": "bar"}}}, true},
|
||||
{kyverno.Condition{"string", kyverno.Equals, "not string"}, false},
|
||||
{kyverno.Condition{1, kyverno.Equals, 2}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.Equals, int64(2)}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.Equals, 2}, false},
|
||||
{kyverno.Condition{1.0, kyverno.Equals, 2.0}, false},
|
||||
{kyverno.Condition{true, kyverno.Equals, false}, false},
|
||||
{kyverno.Condition{false, kyverno.Equals, true}, false},
|
||||
{kyverno.Condition{"1Gi", kyverno.Equals, "10Gi"}, false},
|
||||
{kyverno.Condition{"10Gi", kyverno.Equals, "1024Mi"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.Equals, "5h"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.Equals, "30m"}, false},
|
||||
{kyverno.Condition{"string", kyverno.Equals, 1}, false},
|
||||
{kyverno.Condition{1, kyverno.Equals, "2"}, false},
|
||||
{kyverno.Condition{1.0, kyverno.Equals, "2.0"}, false},
|
||||
{kyverno.Condition{true, kyverno.Equals, "false"}, false},
|
||||
{kyverno.Condition{false, kyverno.Equals, "true"}, false},
|
||||
{kyverno.Condition{map[string]interface{}{"foo": "bar"}, kyverno.Equals, map[string]interface{}{"bar": "foo"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"foo", "bar"}, kyverno.Equals, []interface{}{"bar", "foo"}}, false},
|
||||
{kyverno.Condition{[]interface{}{map[string]string{"foo": "bar"}}, kyverno.Equals, []interface{}{map[string]string{"bar": "foo"}}}, false},
|
||||
{kyverno.Condition{"1h", kyverno.Equals, 3600}, true},
|
||||
{kyverno.Condition{"2h", kyverno.Equals, 3600}, false},
|
||||
{kyverno.Condition{Key: "string", Operator: kyverno.Equals, Value: "string"}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.Equals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.Equals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.Equals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.Equals, Value: 1.0}, true},
|
||||
{kyverno.Condition{Key: true, Operator: kyverno.Equals, Value: true}, true},
|
||||
{kyverno.Condition{Key: false, Operator: kyverno.Equals, Value: false}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.Equals, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.Equals, Value: "1024Mi"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.Equals, Value: "1h"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.Equals, Value: "60m"}, true},
|
||||
{kyverno.Condition{Key: map[string]interface{}{"foo": "bar"}, Operator: kyverno.Equals, Value: map[string]interface{}{"foo": "bar"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"foo", "bar"}, Operator: kyverno.Equals, Value: []interface{}{"foo", "bar"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{map[string]string{"foo": "bar"}}, Operator: kyverno.Equals, Value: []interface{}{map[string]string{"foo": "bar"}}}, true},
|
||||
{kyverno.Condition{Key: "string", Operator: kyverno.Equals, Value: "not string"}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.Equals, Value: 2}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.Equals, Value: int64(2)}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.Equals, Value: 2}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.Equals, Value: 2.0}, false},
|
||||
{kyverno.Condition{Key: true, Operator: kyverno.Equals, Value: false}, false},
|
||||
{kyverno.Condition{Key: false, Operator: kyverno.Equals, Value: true}, false},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.Equals, Value: "10Gi"}, false},
|
||||
{kyverno.Condition{Key: "10Gi", Operator: kyverno.Equals, Value: "1024Mi"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.Equals, Value: "5h"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.Equals, Value: "30m"}, false},
|
||||
{kyverno.Condition{Key: "string", Operator: kyverno.Equals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.Equals, Value: "2"}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.Equals, Value: "2.0"}, false},
|
||||
{kyverno.Condition{Key: true, Operator: kyverno.Equals, Value: "false"}, false},
|
||||
{kyverno.Condition{Key: false, Operator: kyverno.Equals, Value: "true"}, false},
|
||||
{kyverno.Condition{Key: map[string]interface{}{"foo": "bar"}, Operator: kyverno.Equals, Value: map[string]interface{}{"bar": "foo"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"foo", "bar"}, Operator: kyverno.Equals, Value: []interface{}{"bar", "foo"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{map[string]string{"foo": "bar"}}, Operator: kyverno.Equals, Value: []interface{}{map[string]string{"bar": "foo"}}}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.Equals, Value: 3600}, true},
|
||||
{kyverno.Condition{Key: "2h", Operator: kyverno.Equals, Value: 3600}, false},
|
||||
|
||||
// Not Equals
|
||||
{kyverno.Condition{"string", kyverno.NotEquals, "string"}, false},
|
||||
{kyverno.Condition{1, kyverno.NotEquals, 1}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.NotEquals, int64(1)}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.NotEquals, 1}, false},
|
||||
{kyverno.Condition{1.0, kyverno.NotEquals, 1.0}, false},
|
||||
{kyverno.Condition{true, kyverno.NotEquals, false}, true},
|
||||
{kyverno.Condition{false, kyverno.NotEquals, false}, false},
|
||||
{kyverno.Condition{"1Gi", kyverno.NotEquals, "1Gi"}, false},
|
||||
{kyverno.Condition{"10Gi", kyverno.NotEquals, "1024Mi"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.NotEquals, "1h"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.NotEquals, "60m"}, false},
|
||||
{kyverno.Condition{map[string]interface{}{"foo": "bar"}, kyverno.NotEquals, map[string]interface{}{"foo": "bar"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"foo", "bar"}, kyverno.NotEquals, []interface{}{"foo", "bar"}}, false},
|
||||
{kyverno.Condition{[]interface{}{map[string]string{"foo": "bar"}}, kyverno.NotEquals, []interface{}{map[string]string{"foo": "bar"}}}, false},
|
||||
{kyverno.Condition{"string", kyverno.NotEquals, "not string"}, true},
|
||||
{kyverno.Condition{1, kyverno.NotEquals, 2}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.NotEquals, int64(2)}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.NotEquals, 2}, true},
|
||||
{kyverno.Condition{1.0, kyverno.NotEquals, 2.0}, true},
|
||||
{kyverno.Condition{true, kyverno.NotEquals, true}, false},
|
||||
{kyverno.Condition{false, kyverno.NotEquals, true}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.NotEquals, "10Gi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.NotEquals, "1024Mi"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.NotEquals, "5h"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.NotEquals, "30m"}, true},
|
||||
{kyverno.Condition{"string", kyverno.NotEquals, 1}, true},
|
||||
{kyverno.Condition{1, kyverno.NotEquals, "2"}, true},
|
||||
{kyverno.Condition{1.0, kyverno.NotEquals, "2.0"}, true},
|
||||
{kyverno.Condition{true, kyverno.NotEquals, "false"}, true},
|
||||
{kyverno.Condition{false, kyverno.NotEquals, "true"}, true},
|
||||
{kyverno.Condition{map[string]interface{}{"foo": "bar"}, kyverno.NotEquals, map[string]interface{}{"bar": "foo"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"foo", "bar"}, kyverno.NotEquals, []interface{}{"bar", "foo"}}, true},
|
||||
{kyverno.Condition{[]interface{}{map[string]string{"foo": "bar"}}, kyverno.NotEquals, []interface{}{map[string]string{"bar": "foo"}}}, true},
|
||||
{kyverno.Condition{"1h", kyverno.NotEquals, 3600}, false},
|
||||
{kyverno.Condition{"2h", kyverno.NotEquals, 3600}, true},
|
||||
{kyverno.Condition{Key: "string", Operator: kyverno.NotEquals, Value: "string"}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.NotEquals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.NotEquals, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.NotEquals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.NotEquals, Value: 1.0}, false},
|
||||
{kyverno.Condition{Key: true, Operator: kyverno.NotEquals, Value: false}, true},
|
||||
{kyverno.Condition{Key: false, Operator: kyverno.NotEquals, Value: false}, false},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.NotEquals, Value: "1Gi"}, false},
|
||||
{kyverno.Condition{Key: "10Gi", Operator: kyverno.NotEquals, Value: "1024Mi"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.NotEquals, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.NotEquals, Value: "60m"}, false},
|
||||
{kyverno.Condition{Key: map[string]interface{}{"foo": "bar"}, Operator: kyverno.NotEquals, Value: map[string]interface{}{"foo": "bar"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"foo", "bar"}, Operator: kyverno.NotEquals, Value: []interface{}{"foo", "bar"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{map[string]string{"foo": "bar"}}, Operator: kyverno.NotEquals, Value: []interface{}{map[string]string{"foo": "bar"}}}, false},
|
||||
{kyverno.Condition{Key: "string", Operator: kyverno.NotEquals, Value: "not string"}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.NotEquals, Value: 2}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.NotEquals, Value: int64(2)}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.NotEquals, Value: 2}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.NotEquals, Value: 2.0}, true},
|
||||
{kyverno.Condition{Key: true, Operator: kyverno.NotEquals, Value: true}, false},
|
||||
{kyverno.Condition{Key: false, Operator: kyverno.NotEquals, Value: true}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.NotEquals, Value: "10Gi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.NotEquals, Value: "1024Mi"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.NotEquals, Value: "5h"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.NotEquals, Value: "30m"}, true},
|
||||
{kyverno.Condition{Key: "string", Operator: kyverno.NotEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.NotEquals, Value: "2"}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.NotEquals, Value: "2.0"}, true},
|
||||
{kyverno.Condition{Key: true, Operator: kyverno.NotEquals, Value: "false"}, true},
|
||||
{kyverno.Condition{Key: false, Operator: kyverno.NotEquals, Value: "true"}, true},
|
||||
{kyverno.Condition{Key: map[string]interface{}{"foo": "bar"}, Operator: kyverno.NotEquals, Value: map[string]interface{}{"bar": "foo"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"foo", "bar"}, Operator: kyverno.NotEquals, Value: []interface{}{"bar", "foo"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{map[string]string{"foo": "bar"}}, Operator: kyverno.NotEquals, Value: []interface{}{map[string]string{"bar": "foo"}}}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.NotEquals, Value: 3600}, false},
|
||||
{kyverno.Condition{Key: "2h", Operator: kyverno.NotEquals, Value: 3600}, true},
|
||||
|
||||
// Greater Than
|
||||
{kyverno.Condition{10, kyverno.GreaterThan, 1}, true},
|
||||
{kyverno.Condition{1.5, kyverno.GreaterThan, 1.0}, true},
|
||||
{kyverno.Condition{1.5, kyverno.GreaterThan, 1}, true},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, 10}, false},
|
||||
{kyverno.Condition{1.0, kyverno.GreaterThan, 1.5}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, 1.5}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, 1}, false},
|
||||
{kyverno.Condition{1.0, kyverno.GreaterThan, 1.0}, false},
|
||||
{kyverno.Condition{"10Gi", kyverno.GreaterThan, "1Gi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.GreaterThan, "1Mi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.GreaterThan, "10Gi"}, false},
|
||||
{kyverno.Condition{"10Mi", kyverno.GreaterThan, "10Mi"}, false},
|
||||
{kyverno.Condition{"10h", kyverno.GreaterThan, "1h"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.GreaterThan, "30m"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.GreaterThan, "1h"}, false},
|
||||
{kyverno.Condition{"1Gi", kyverno.GreaterThan, "1Gi"}, false},
|
||||
{kyverno.Condition{"10", kyverno.GreaterThan, 1}, true},
|
||||
{kyverno.Condition{100, kyverno.GreaterThan, "10"}, true},
|
||||
{kyverno.Condition{"100", kyverno.GreaterThan, "10"}, true},
|
||||
{kyverno.Condition{"10", kyverno.GreaterThan, "10"}, false},
|
||||
{kyverno.Condition{"1", kyverno.GreaterThan, "10"}, false},
|
||||
{kyverno.Condition{"1", kyverno.GreaterThan, 10}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, "10"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.GreaterThan, 3600}, false},
|
||||
{kyverno.Condition{"2h", kyverno.GreaterThan, 3600}, true},
|
||||
{kyverno.Condition{3600, kyverno.GreaterThan, "1h"}, false},
|
||||
{kyverno.Condition{3600, kyverno.GreaterThan, "30m"}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThan, int64(1)}, false},
|
||||
{kyverno.Condition{int64(10), kyverno.GreaterThan, int64(1)}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThan, int64(10)}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThan, 1}, false},
|
||||
{kyverno.Condition{int64(10), kyverno.GreaterThan, 1}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThan, 10}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, int64(1)}, false},
|
||||
{kyverno.Condition{10, kyverno.GreaterThan, int64(1)}, true},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, int64(10)}, false},
|
||||
{kyverno.Condition{-5, kyverno.GreaterThan, 1}, false},
|
||||
{kyverno.Condition{-5, kyverno.GreaterThan, -10}, true},
|
||||
{kyverno.Condition{1, kyverno.GreaterThan, -10}, true},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.GreaterThan, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.GreaterThan, Value: 1.0}, true},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.GreaterThan, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: 10}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.GreaterThan, Value: 1.5}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: 1.5}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.GreaterThan, Value: 1.0}, false},
|
||||
{kyverno.Condition{Key: "10Gi", Operator: kyverno.GreaterThan, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.GreaterThan, Value: "1Mi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.GreaterThan, Value: "10Gi"}, false},
|
||||
{kyverno.Condition{Key: "10Mi", Operator: kyverno.GreaterThan, Value: "10Mi"}, false},
|
||||
{kyverno.Condition{Key: "10h", Operator: kyverno.GreaterThan, Value: "1h"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.GreaterThan, Value: "30m"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.GreaterThan, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.GreaterThan, Value: "1Gi"}, false},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.GreaterThan, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 100, Operator: kyverno.GreaterThan, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "100", Operator: kyverno.GreaterThan, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.GreaterThan, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.GreaterThan, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.GreaterThan, Value: 10}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.GreaterThan, Value: 3600}, false},
|
||||
{kyverno.Condition{Key: "2h", Operator: kyverno.GreaterThan, Value: 3600}, true},
|
||||
{kyverno.Condition{Key: 3600, Operator: kyverno.GreaterThan, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: 3600, Operator: kyverno.GreaterThan, Value: "30m"}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThan, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.GreaterThan, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThan, Value: int64(10)}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.GreaterThan, Value: 1}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThan, Value: 10}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.GreaterThan, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: int64(10)}, false},
|
||||
{kyverno.Condition{Key: -5, Operator: kyverno.GreaterThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: -5, Operator: kyverno.GreaterThan, Value: -10}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThan, Value: -10}, true},
|
||||
|
||||
// Less Than
|
||||
{kyverno.Condition{10, kyverno.LessThan, 1}, false},
|
||||
{kyverno.Condition{1.5, kyverno.LessThan, 1.0}, false},
|
||||
{kyverno.Condition{1.5, kyverno.LessThan, 1}, false},
|
||||
{kyverno.Condition{1, kyverno.LessThan, 10}, true},
|
||||
{kyverno.Condition{1.0, kyverno.LessThan, 1.5}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThan, 1.5}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThan, 1}, false},
|
||||
{kyverno.Condition{1.0, kyverno.LessThan, 1.0}, false},
|
||||
{kyverno.Condition{"10Gi", kyverno.LessThan, "1Gi"}, false},
|
||||
{kyverno.Condition{"1Gi", kyverno.LessThan, "10Gi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.LessThan, "1Mi"}, false},
|
||||
{kyverno.Condition{"1Mi", kyverno.LessThan, "1Gi"}, true},
|
||||
{kyverno.Condition{"10h", kyverno.LessThan, "1h"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.LessThan, "30m"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.LessThan, "1h"}, false},
|
||||
{kyverno.Condition{"1Gi", kyverno.LessThan, "1Gi"}, false},
|
||||
{kyverno.Condition{"10", kyverno.LessThan, 1}, false},
|
||||
{kyverno.Condition{100, kyverno.LessThan, "10"}, false},
|
||||
{kyverno.Condition{"100", kyverno.LessThan, "10"}, false},
|
||||
{kyverno.Condition{"10", kyverno.LessThan, "10"}, false},
|
||||
{kyverno.Condition{"1", kyverno.LessThan, "10"}, true},
|
||||
{kyverno.Condition{"1", kyverno.LessThan, 10}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThan, "10"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.LessThan, 3600}, false},
|
||||
{kyverno.Condition{"30m", kyverno.LessThan, 3600}, true},
|
||||
{kyverno.Condition{3600, kyverno.LessThan, "1h"}, false},
|
||||
{kyverno.Condition{3600, kyverno.LessThan, "30m"}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThan, int64(1)}, false},
|
||||
{kyverno.Condition{int64(10), kyverno.LessThan, int64(1)}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThan, int64(10)}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThan, 1}, false},
|
||||
{kyverno.Condition{int64(10), kyverno.LessThan, 1}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThan, 10}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThan, int64(1)}, false},
|
||||
{kyverno.Condition{10, kyverno.LessThan, int64(1)}, false},
|
||||
{kyverno.Condition{1, kyverno.LessThan, int64(10)}, true},
|
||||
{kyverno.Condition{-5, kyverno.LessThan, 1}, true},
|
||||
{kyverno.Condition{-5, kyverno.LessThan, -10}, false},
|
||||
{kyverno.Condition{1, kyverno.LessThan, -10}, false},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.LessThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.LessThan, Value: 1.0}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.LessThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: 10}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.LessThan, Value: 1.5}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: 1.5}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.LessThan, Value: 1.0}, false},
|
||||
{kyverno.Condition{Key: "10Gi", Operator: kyverno.LessThan, Value: "1Gi"}, false},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.LessThan, Value: "10Gi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.LessThan, Value: "1Mi"}, false},
|
||||
{kyverno.Condition{Key: "1Mi", Operator: kyverno.LessThan, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "10h", Operator: kyverno.LessThan, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.LessThan, Value: "30m"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.LessThan, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.LessThan, Value: "1Gi"}, false},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.LessThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 100, Operator: kyverno.LessThan, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "100", Operator: kyverno.LessThan, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.LessThan, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.LessThan, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.LessThan, Value: 10}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.LessThan, Value: 3600}, false},
|
||||
{kyverno.Condition{Key: "30m", Operator: kyverno.LessThan, Value: 3600}, true},
|
||||
{kyverno.Condition{Key: 3600, Operator: kyverno.LessThan, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: 3600, Operator: kyverno.LessThan, Value: "30m"}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThan, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.LessThan, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThan, Value: int64(10)}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.LessThan, Value: 1}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThan, Value: 10}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.LessThan, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: int64(10)}, true},
|
||||
{kyverno.Condition{Key: -5, Operator: kyverno.LessThan, Value: 1}, true},
|
||||
{kyverno.Condition{Key: -5, Operator: kyverno.LessThan, Value: -10}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThan, Value: -10}, false},
|
||||
|
||||
// Greater Than or Equal
|
||||
{kyverno.Condition{10, kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{1.5, kyverno.GreaterThanOrEquals, 1.0}, true},
|
||||
{kyverno.Condition{1.5, kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{1, kyverno.GreaterThanOrEquals, 10}, false},
|
||||
{kyverno.Condition{1.0, kyverno.GreaterThanOrEquals, 1.5}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThanOrEquals, 1.5}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{1.0, kyverno.GreaterThanOrEquals, 1.0}, true},
|
||||
{kyverno.Condition{1.0, kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{"10Gi", kyverno.GreaterThanOrEquals, "1Gi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.GreaterThanOrEquals, "1Mi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.GreaterThanOrEquals, "10Gi"}, false},
|
||||
{kyverno.Condition{"10h", kyverno.GreaterThanOrEquals, "1h"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.GreaterThanOrEquals, "30m"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.GreaterThanOrEquals, "1h"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.GreaterThanOrEquals, "1Gi"}, true},
|
||||
{kyverno.Condition{"10", kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{100, kyverno.GreaterThanOrEquals, "10"}, true},
|
||||
{kyverno.Condition{"100", kyverno.GreaterThanOrEquals, "10"}, true},
|
||||
{kyverno.Condition{"10", kyverno.GreaterThanOrEquals, "10"}, true},
|
||||
{kyverno.Condition{"1", kyverno.GreaterThanOrEquals, "10"}, false},
|
||||
{kyverno.Condition{"1", kyverno.GreaterThanOrEquals, 10}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThanOrEquals, "10"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.GreaterThanOrEquals, 3600}, true},
|
||||
{kyverno.Condition{"2h", kyverno.GreaterThanOrEquals, 3600}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThanOrEquals, int64(1)}, true},
|
||||
{kyverno.Condition{int64(10), kyverno.GreaterThanOrEquals, int64(1)}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThanOrEquals, int64(10)}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{int64(10), kyverno.GreaterThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.GreaterThanOrEquals, 10}, false},
|
||||
{kyverno.Condition{1, kyverno.GreaterThanOrEquals, int64(1)}, true},
|
||||
{kyverno.Condition{10, kyverno.GreaterThanOrEquals, int64(1)}, true},
|
||||
{kyverno.Condition{1, kyverno.GreaterThanOrEquals, int64(10)}, false},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.GreaterThanOrEquals, Value: 1.0}, true},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThanOrEquals, Value: 10}, false},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.GreaterThanOrEquals, Value: 1.5}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThanOrEquals, Value: 1.5}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.GreaterThanOrEquals, Value: 1.0}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: "10Gi", Operator: kyverno.GreaterThanOrEquals, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.GreaterThanOrEquals, Value: "1Mi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.GreaterThanOrEquals, Value: "10Gi"}, false},
|
||||
{kyverno.Condition{Key: "10h", Operator: kyverno.GreaterThanOrEquals, Value: "1h"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.GreaterThanOrEquals, Value: "30m"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.GreaterThanOrEquals, Value: "1h"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.GreaterThanOrEquals, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 100, Operator: kyverno.GreaterThanOrEquals, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "100", Operator: kyverno.GreaterThanOrEquals, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.GreaterThanOrEquals, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.GreaterThanOrEquals, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.GreaterThanOrEquals, Value: 10}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThanOrEquals, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.GreaterThanOrEquals, Value: 3600}, true},
|
||||
{kyverno.Condition{Key: "2h", Operator: kyverno.GreaterThanOrEquals, Value: 3600}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThanOrEquals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.GreaterThanOrEquals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThanOrEquals, Value: int64(10)}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.GreaterThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.GreaterThanOrEquals, Value: 10}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThanOrEquals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.GreaterThanOrEquals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.GreaterThanOrEquals, Value: int64(10)}, false},
|
||||
|
||||
// Less Than or Equal
|
||||
{kyverno.Condition{10, kyverno.LessThanOrEquals, 1}, false},
|
||||
{kyverno.Condition{1.5, kyverno.LessThanOrEquals, 1.0}, false},
|
||||
{kyverno.Condition{1.5, kyverno.LessThanOrEquals, 1}, false},
|
||||
{kyverno.Condition{1, kyverno.LessThanOrEquals, 10}, true},
|
||||
{kyverno.Condition{1.0, kyverno.LessThanOrEquals, 1.5}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThanOrEquals, 1.5}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{1.0, kyverno.LessThanOrEquals, 1.0}, true},
|
||||
{kyverno.Condition{"10Gi", kyverno.LessThanOrEquals, "1Gi"}, false},
|
||||
{kyverno.Condition{"1Gi", kyverno.LessThanOrEquals, "10Gi"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.LessThanOrEquals, "1Mi"}, false},
|
||||
{kyverno.Condition{"1Mi", kyverno.LessThanOrEquals, "1Gi"}, true},
|
||||
{kyverno.Condition{"10h", kyverno.LessThanOrEquals, "1h"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.LessThanOrEquals, "30m"}, false},
|
||||
{kyverno.Condition{"1h", kyverno.LessThanOrEquals, "1h"}, true},
|
||||
{kyverno.Condition{"1Gi", kyverno.LessThanOrEquals, "1Gi"}, true},
|
||||
{kyverno.Condition{"10", kyverno.LessThanOrEquals, 1}, false},
|
||||
{kyverno.Condition{100, kyverno.LessThanOrEquals, "10"}, false},
|
||||
{kyverno.Condition{"100", kyverno.LessThanOrEquals, "10"}, false},
|
||||
{kyverno.Condition{"10", kyverno.LessThanOrEquals, "10"}, true},
|
||||
{kyverno.Condition{"1", kyverno.LessThanOrEquals, "10"}, true},
|
||||
{kyverno.Condition{"1", kyverno.LessThanOrEquals, 10}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThanOrEquals, "10"}, true},
|
||||
{kyverno.Condition{"1h", kyverno.LessThanOrEquals, 3600}, true},
|
||||
{kyverno.Condition{"2h", kyverno.LessThanOrEquals, 3600}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThanOrEquals, int64(1)}, true},
|
||||
{kyverno.Condition{int64(10), kyverno.LessThanOrEquals, int64(1)}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThanOrEquals, int64(10)}, true},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThanOrEquals, 1}, true},
|
||||
{kyverno.Condition{int64(10), kyverno.LessThanOrEquals, 1}, false},
|
||||
{kyverno.Condition{int64(1), kyverno.LessThanOrEquals, 10}, true},
|
||||
{kyverno.Condition{1, kyverno.LessThanOrEquals, int64(1)}, true},
|
||||
{kyverno.Condition{10, kyverno.LessThanOrEquals, int64(1)}, false},
|
||||
{kyverno.Condition{1, kyverno.LessThanOrEquals, int64(10)}, true},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.LessThanOrEquals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.LessThanOrEquals, Value: 1.0}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.LessThanOrEquals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThanOrEquals, Value: 10}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.LessThanOrEquals, Value: 1.5}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThanOrEquals, Value: 1.5}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: 1.0, Operator: kyverno.LessThanOrEquals, Value: 1.0}, true},
|
||||
{kyverno.Condition{Key: "10Gi", Operator: kyverno.LessThanOrEquals, Value: "1Gi"}, false},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.LessThanOrEquals, Value: "10Gi"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.LessThanOrEquals, Value: "1Mi"}, false},
|
||||
{kyverno.Condition{Key: "1Mi", Operator: kyverno.LessThanOrEquals, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "10h", Operator: kyverno.LessThanOrEquals, Value: "1h"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.LessThanOrEquals, Value: "30m"}, false},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.LessThanOrEquals, Value: "1h"}, true},
|
||||
{kyverno.Condition{Key: "1Gi", Operator: kyverno.LessThanOrEquals, Value: "1Gi"}, true},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.LessThanOrEquals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: 100, Operator: kyverno.LessThanOrEquals, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "100", Operator: kyverno.LessThanOrEquals, Value: "10"}, false},
|
||||
{kyverno.Condition{Key: "10", Operator: kyverno.LessThanOrEquals, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.LessThanOrEquals, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.LessThanOrEquals, Value: 10}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThanOrEquals, Value: "10"}, true},
|
||||
{kyverno.Condition{Key: "1h", Operator: kyverno.LessThanOrEquals, Value: 3600}, true},
|
||||
{kyverno.Condition{Key: "2h", Operator: kyverno.LessThanOrEquals, Value: 3600}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThanOrEquals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.LessThanOrEquals, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThanOrEquals, Value: int64(10)}, true},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThanOrEquals, Value: 1}, true},
|
||||
{kyverno.Condition{Key: int64(10), Operator: kyverno.LessThanOrEquals, Value: 1}, false},
|
||||
{kyverno.Condition{Key: int64(1), Operator: kyverno.LessThanOrEquals, Value: 10}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThanOrEquals, Value: int64(1)}, true},
|
||||
{kyverno.Condition{Key: 10, Operator: kyverno.LessThanOrEquals, Value: int64(1)}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.LessThanOrEquals, Value: int64(10)}, true},
|
||||
|
||||
// In
|
||||
{kyverno.Condition{1, kyverno.In, []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{1.5, kyverno.In, []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{"1", kyverno.In, []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "2.2.2.2"}, kyverno.In, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{5, kyverno.In, []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{5.5, kyverno.In, []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{"5", kyverno.In, []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "4.4.4.4"}, kyverno.In, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.In, Value: []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.In, Value: []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.In, Value: []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "2.2.2.2"}, Operator: kyverno.In, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: 5, Operator: kyverno.In, Value: []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: 5.5, Operator: kyverno.In, Value: []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: "5", Operator: kyverno.In, Value: []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "4.4.4.4"}, Operator: kyverno.In, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
|
||||
// Not In
|
||||
{kyverno.Condition{1, kyverno.NotIn, []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{1.5, kyverno.NotIn, []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{"1", kyverno.NotIn, []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "2.2.2.2"}, kyverno.NotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{5, kyverno.NotIn, []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{5.5, kyverno.NotIn, []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{"5", kyverno.NotIn, []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "4.4.4.4"}, kyverno.NotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.NotIn, Value: []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.NotIn, Value: []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.NotIn, Value: []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "2.2.2.2"}, Operator: kyverno.NotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: 5, Operator: kyverno.NotIn, Value: []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: 5.5, Operator: kyverno.NotIn, Value: []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: "5", Operator: kyverno.NotIn, Value: []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "4.4.4.4"}, Operator: kyverno.NotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
|
||||
// Any In
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "5.5.5.5"}, kyverno.AnyIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"4.4.4.4", "5.5.5.5"}, kyverno.AnyIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "5.5.5.5"}, kyverno.AnyIn, []interface{}{"1.1.1.1"}}, true},
|
||||
{kyverno.Condition{[]interface{}{1, 2}, kyverno.AnyIn, []interface{}{1, 2, 3, 4}}, true},
|
||||
{kyverno.Condition{[]interface{}{1, 5}, kyverno.AnyIn, []interface{}{1, 2, 3, 4}}, true},
|
||||
{kyverno.Condition{[]interface{}{5}, kyverno.AnyIn, []interface{}{1, 2, 3, 4}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "5.5.5.5"}, Operator: kyverno.AnyIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"4.4.4.4", "5.5.5.5"}, Operator: kyverno.AnyIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "5.5.5.5"}, Operator: kyverno.AnyIn, Value: []interface{}{"1.1.1.1"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{1, 2}, Operator: kyverno.AnyIn, Value: []interface{}{1, 2, 3, 4}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{1, 5}, Operator: kyverno.AnyIn, Value: []interface{}{1, 2, 3, 4}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{5}, Operator: kyverno.AnyIn, Value: []interface{}{1, 2, 3, 4}}, false},
|
||||
|
||||
// All In
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "2.2.2.2"}, kyverno.AllIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "5.5.5.5"}, kyverno.AllIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"4.4.4.4", "5.5.5.5"}, kyverno.AllIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "5.5.5.5"}, kyverno.AllIn, []interface{}{"1.1.1.1"}}, false},
|
||||
{kyverno.Condition{[]interface{}{1, 2}, kyverno.AllIn, []interface{}{1, 2, 3, 4}}, true},
|
||||
{kyverno.Condition{[]interface{}{1, 5}, kyverno.AllIn, []interface{}{1, 2, 3, 4}}, false},
|
||||
{kyverno.Condition{[]interface{}{5}, kyverno.AllIn, []interface{}{1, 2, 3, 4}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "2.2.2.2"}, Operator: kyverno.AllIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "5.5.5.5"}, Operator: kyverno.AllIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"4.4.4.4", "5.5.5.5"}, Operator: kyverno.AllIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "5.5.5.5"}, Operator: kyverno.AllIn, Value: []interface{}{"1.1.1.1"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{1, 2}, Operator: kyverno.AllIn, Value: []interface{}{1, 2, 3, 4}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{1, 5}, Operator: kyverno.AllIn, Value: []interface{}{1, 2, 3, 4}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{5}, Operator: kyverno.AllIn, Value: []interface{}{1, 2, 3, 4}}, false},
|
||||
|
||||
// All Not In
|
||||
{kyverno.Condition{1, kyverno.AllNotIn, []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{1.5, kyverno.AllNotIn, []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{"1", kyverno.AllNotIn, []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "2.2.2.2"}, kyverno.AllNotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{5, kyverno.AllNotIn, []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{5.5, kyverno.AllNotIn, []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{"5", kyverno.AllNotIn, []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "4.4.4.4"}, kyverno.AllNotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"5.5.5.5", "4.4.4.4"}, kyverno.AllNotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.AllNotIn, Value: []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.AllNotIn, Value: []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.AllNotIn, Value: []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "2.2.2.2"}, Operator: kyverno.AllNotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: 5, Operator: kyverno.AllNotIn, Value: []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: 5.5, Operator: kyverno.AllNotIn, Value: []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: "5", Operator: kyverno.AllNotIn, Value: []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "4.4.4.4"}, Operator: kyverno.AllNotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"5.5.5.5", "4.4.4.4"}, Operator: kyverno.AllNotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
|
||||
// Any Not In
|
||||
{kyverno.Condition{1, kyverno.AnyNotIn, []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{1.5, kyverno.AnyNotIn, []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{"1", kyverno.AnyNotIn, []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "2.2.2.2"}, kyverno.AnyNotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{5, kyverno.AnyNotIn, []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{5.5, kyverno.AnyNotIn, []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{"5", kyverno.AnyNotIn, []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"1.1.1.1", "4.4.4.4"}, kyverno.AnyNotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{[]interface{}{"5.5.5.5", "4.4.4.4"}, kyverno.AnyNotIn, []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: 1, Operator: kyverno.AnyNotIn, Value: []interface{}{1, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: 1.5, Operator: kyverno.AnyNotIn, Value: []interface{}{1, 1.5, 2, 3}}, false},
|
||||
{kyverno.Condition{Key: "1", Operator: kyverno.AnyNotIn, Value: []interface{}{"1", "2", "3"}}, false},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "2.2.2.2"}, Operator: kyverno.AnyNotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, false},
|
||||
{kyverno.Condition{Key: 5, Operator: kyverno.AnyNotIn, Value: []interface{}{1, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: 5.5, Operator: kyverno.AnyNotIn, Value: []interface{}{1, 1.5, 2, 3}}, true},
|
||||
{kyverno.Condition{Key: "5", Operator: kyverno.AnyNotIn, Value: []interface{}{"1", "2", "3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"1.1.1.1", "4.4.4.4"}, Operator: kyverno.AnyNotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
{kyverno.Condition{Key: []interface{}{"5.5.5.5", "4.4.4.4"}, Operator: kyverno.AnyNotIn, Value: []interface{}{"1.1.1.1", "2.2.2.2", "3.3.3.3"}}, true},
|
||||
}
|
||||
|
||||
ctx := context.NewContext()
|
||||
|
|
Loading…
Add table
Reference in a new issue