mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
chore: use v2 for exceptions in chainsaw tests (#10529)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
parent
585aff0aca
commit
b7bf894fe9
40 changed files with 44 additions and 44 deletions
|
@ -40,7 +40,7 @@ func TestCommandWithAny(t *testing.T) {
|
|||
out, err := io.ReadAll(b)
|
||||
assert.NoError(t, err)
|
||||
expected := `
|
||||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: test
|
||||
|
@ -72,7 +72,7 @@ func TestCommandWithAll(t *testing.T) {
|
|||
out, err := io.ReadAll(b)
|
||||
assert.NoError(t, err)
|
||||
expected := `
|
||||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: test
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: {{ .Name }}
|
||||
|
|
|
@ -288,7 +288,7 @@ func NewPolicyExceptionEvents(engineResponse engineapi.EngineResponse, ruleResp
|
|||
func NewCleanupPolicyEvent(policy kyvernov2beta1.CleanupPolicyInterface, resource unstructured.Unstructured, err error) Info {
|
||||
regarding := corev1.ObjectReference{
|
||||
// TODO: iirc it's not safe to assume api version is set
|
||||
APIVersion: "kyverno.io/v2beta1",
|
||||
APIVersion: "kyverno.io/v2",
|
||||
Kind: policy.GetKind(),
|
||||
Name: policy.GetName(),
|
||||
Namespace: policy.GetNamespace(),
|
||||
|
|
|
@ -26,7 +26,7 @@ func Test_Validate(t *testing.T) {
|
|||
Enabled: false,
|
||||
Namespace: "kyverno",
|
||||
},
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
},
|
||||
want: 1,
|
||||
},
|
||||
|
@ -37,7 +37,7 @@ func Test_Validate(t *testing.T) {
|
|||
Enabled: true,
|
||||
Namespace: "kyverno",
|
||||
},
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"delta"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
},
|
||||
want: 1,
|
||||
},
|
||||
|
@ -48,7 +48,7 @@ func Test_Validate(t *testing.T) {
|
|||
Enabled: true,
|
||||
Namespace: "kyverno",
|
||||
},
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
},
|
||||
want: 0,
|
||||
},
|
||||
|
@ -59,7 +59,7 @@ func Test_Validate(t *testing.T) {
|
|||
Enabled: true,
|
||||
Namespace: "",
|
||||
},
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2beta1","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
resource: []byte(`{"apiVersion":"kyverno.io/v2","kind":"PolicyException","metadata":{"name":"enforce-label-exception","namespace":"kyverno"},"spec":{"exceptions":[{"policyName":"enforce-label","ruleNames":["enforce-label"]}],"match":{"any":[{"resources":{"kinds":["Pod"]}}]}}}`),
|
||||
},
|
||||
want: 0,
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: delta-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: container-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: mynewpolex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: delta-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: polex-right
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: polex-wrong
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: container-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: policy-exception-allow-latest
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: failing-container-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: passing-container-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: mynewpolex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: mynewpolex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: policy-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: label-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: mynewpolex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: container-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: pod-security-exception
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: mynewpolex
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: allow-scaling-nginx-test
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
apiVersion: kyverno.io/v2beta1
|
||||
apiVersion: kyverno.io/v2
|
||||
kind: PolicyException
|
||||
metadata:
|
||||
name: allow-scaling-nginx-test
|
||||
|
|
Loading…
Reference in a new issue