From 46b9a6e3e2bb584e2e7cc60bf122035143febb26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?=
 <charles.edouard@nirmata.com>
Date: Fri, 14 Jun 2024 15:19:48 +0200
Subject: [PATCH] test: add cleanup v2 chainsaw tests (#10476)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
---
 .../clusterpolicy/cleanup-pod/README.md       |  0
 .../cleanup-pod/chainsaw-test.yaml            |  0
 .../clusterpolicy/cleanup-pod/pod-assert.yaml |  0
 .../clusterpolicy/cleanup-pod/pod.yaml        |  0
 .../v2/clusterpolicy/cleanup-pod/policy.yaml  | 20 ++++++++++++
 .../clusterpolicy/cleanup-pod/rbac.yaml       |  0
 .../context-cleanup-pod/README.md             |  0
 .../context-cleanup-pod/chainsaw-test.yaml    |  0
 .../context-cleanup-pod/pod-assert.yaml       |  0
 .../context-cleanup-pod/pod.yaml              |  0
 .../context-cleanup-pod/policy.yaml           | 28 +++++++++++++++++
 .../context-cleanup-pod/rbac.yaml             |  0
 .../{ => v2}/policy/cleanup-pod/README.md     |  0
 .../policy/cleanup-pod/chainsaw-test.yaml     |  0
 .../policy/cleanup-pod/pod-assert.yaml        |  0
 .../{ => v2}/policy/cleanup-pod/pod.yaml      |  0
 .../cleanup/v2/policy/cleanup-pod/policy.yaml | 18 +++++++++++
 .../{ => v2}/policy/cleanup-pod/rbac.yaml     |  0
 .../{ => v2}/validation/cron-format/README.md |  0
 .../validation/cron-format/chainsaw-test.yaml |  0
 .../validation/cron-format/clusterpolicy.yaml | 16 ++++++++++
 .../validation/cron-format/invalidpolicy.yaml | 17 ++++++++++
 .../v2/validation/cron-format/policy.yaml     | 17 ++++++++++
 .../no-user-info-in-match/README.md           |  0
 .../no-user-info-in-match/chainsaw-test.yaml  |  0
 .../cleanuppolicy-with-clusterroles.yaml      | 13 ++++++++
 .../cleanuppolicy-with-roles.yaml             | 13 ++++++++
 .../cleanuppolicy-with-subjects.yaml          | 14 +++++++++
 .../chainsaw-test.yaml                        |  0
 .../cleanuppolicy-with-configmap.yaml         | 25 +++++++++++++++
 .../cleanuppolicy-with-image-registry.yaml    | 24 ++++++++++++++
 .../clusterpolicy/cleanup-pod/README.md       |  9 ++++++
 .../cleanup-pod/chainsaw-test.yaml            | 31 +++++++++++++++++++
 .../clusterpolicy/cleanup-pod/pod-assert.yaml |  5 +++
 .../clusterpolicy/cleanup-pod/pod.yaml        |  9 ++++++
 .../clusterpolicy/cleanup-pod/policy.yaml     |  0
 .../clusterpolicy/cleanup-pod/rbac.yaml       | 26 ++++++++++++++++
 .../context-cleanup-pod/README.md             |  9 ++++++
 .../context-cleanup-pod/chainsaw-test.yaml    | 27 ++++++++++++++++
 .../context-cleanup-pod/pod-assert.yaml       |  5 +++
 .../context-cleanup-pod/pod.yaml              |  9 ++++++
 .../context-cleanup-pod/policy.yaml           |  0
 .../context-cleanup-pod/rbac.yaml             | 26 ++++++++++++++++
 .../v2beta1/policy/cleanup-pod/README.md      | 10 ++++++
 .../policy/cleanup-pod/chainsaw-test.yaml     | 27 ++++++++++++++++
 .../policy/cleanup-pod/pod-assert.yaml        |  5 +++
 .../v2beta1/policy/cleanup-pod/pod.yaml       |  9 ++++++
 .../policy/cleanup-pod/policy.yaml            |  0
 .../v2beta1/policy/cleanup-pod/rbac.yaml      | 26 ++++++++++++++++
 .../v2beta1/validation/cron-format/README.md  |  4 +++
 .../validation/cron-format/chainsaw-test.yaml | 26 ++++++++++++++++
 .../validation/cron-format/clusterpolicy.yaml |  0
 .../validation/cron-format/invalidpolicy.yaml |  0
 .../validation/cron-format/policy.yaml        |  0
 .../no-user-info-in-match/README.md           |  8 +++++
 .../no-user-info-in-match/chainsaw-test.yaml  | 24 ++++++++++++++
 .../cleanuppolicy-with-clusterroles.yaml      |  0
 .../cleanuppolicy-with-roles.yaml             |  0
 .../cleanuppolicy-with-subjects.yaml          |  0
 .../chainsaw-test.yaml                        | 19 ++++++++++++
 .../cleanuppolicy-with-configmap.yaml         |  0
 .../cleanuppolicy-with-image-registry.yaml    |  0
 62 files changed, 519 insertions(+)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/cleanup-pod/README.md (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/cleanup-pod/chainsaw-test.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/cleanup-pod/pod-assert.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/cleanup-pod/pod.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/policy.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/cleanup-pod/rbac.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/context-cleanup-pod/README.md (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/context-cleanup-pod/pod-assert.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/context-cleanup-pod/pod.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/policy.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2}/clusterpolicy/context-cleanup-pod/rbac.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/policy/cleanup-pod/README.md (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/policy/cleanup-pod/chainsaw-test.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/policy/cleanup-pod/pod-assert.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/policy/cleanup-pod/pod.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/policy.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2}/policy/cleanup-pod/rbac.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/validation/cron-format/README.md (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/validation/cron-format/chainsaw-test.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/cron-format/clusterpolicy.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/cron-format/invalidpolicy.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/cron-format/policy.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2}/validation/no-user-info-in-match/README.md (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2}/validation/no-user-info-in-match/chainsaw-test.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2}/validation/not-supported-attributes-in-context/chainsaw-test.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/README.md
 create mode 100755 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/chainsaw-test.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod-assert.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/clusterpolicy/cleanup-pod/policy.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/rbac.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/README.md
 create mode 100755 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod-assert.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/clusterpolicy/context-cleanup-pod/policy.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/rbac.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/README.md
 create mode 100755 test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/chainsaw-test.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod-assert.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/policy/cleanup-pod/policy.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/rbac.yaml
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/README.md
 create mode 100755 test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/chainsaw-test.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/cron-format/clusterpolicy.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/cron-format/invalidpolicy.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/cron-format/policy.yaml (100%)
 create mode 100644 test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/README.md
 create mode 100755 test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/chainsaw-test.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml (100%)
 create mode 100755 test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/chainsaw-test.yaml
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml (100%)
 rename test/conformance/chainsaw/cleanup/{ => v2beta1}/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml (100%)

diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/README.md b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/README.md
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/README.md
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/README.md
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/chainsaw-test.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/chainsaw-test.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/chainsaw-test.yaml
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/pod-assert.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/pod-assert.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/pod-assert.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/pod-assert.yaml
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/pod.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/pod.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/pod.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/pod.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/policy.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/policy.yaml
new file mode 100644
index 0000000000..f7937f4249
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/policy.yaml
@@ -0,0 +1,20 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanup-pod
+spec:
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+  conditions:
+    all:
+      - key: "{{ target.metadata.name }}"
+        operator: Equals
+        value: example
+      - key: "{{ target.metadata.namespace }}"
+        operator: Equals
+        value: default
+  ## execute every minute
+  schedule: "*/1 * * * *"
\ No newline at end of file
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/rbac.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/rbac.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/rbac.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/cleanup-pod/rbac.yaml
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/README.md b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/README.md
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/README.md
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/README.md
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/pod-assert.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/pod-assert.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/pod-assert.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/pod-assert.yaml
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/pod.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/pod.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/pod.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/pod.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/policy.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/policy.yaml
new file mode 100644
index 0000000000..baf2ee124f
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/policy.yaml
@@ -0,0 +1,28 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanup-pod
+spec:
+  context:
+    - name: varNamespace
+      apiCall:
+        urlPath: "/api/v1/namespaces/default"
+        jmesPath: metadata.name
+    - name: varname
+      variable:
+        value: "example"
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+  conditions:
+    all:
+      - key: "{{ target.metadata.name }}"
+        operator: Equals
+        value: "{{ varname }}"
+      - key: "{{ target.metadata.namespace }}"
+        operator: Equals
+        value: "{{ varNamespace }}"
+  ## execute every minute
+  schedule: "*/1 * * * *"
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/rbac.yaml b/test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/rbac.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/rbac.yaml
rename to test/conformance/chainsaw/cleanup/v2/clusterpolicy/context-cleanup-pod/rbac.yaml
diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/README.md b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/README.md
similarity index 100%
rename from test/conformance/chainsaw/cleanup/policy/cleanup-pod/README.md
rename to test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/README.md
diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/chainsaw-test.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/policy/cleanup-pod/chainsaw-test.yaml
rename to test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/chainsaw-test.yaml
diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/pod-assert.yaml b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/pod-assert.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/policy/cleanup-pod/pod-assert.yaml
rename to test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/pod-assert.yaml
diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/pod.yaml b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/pod.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/policy/cleanup-pod/pod.yaml
rename to test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/pod.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/policy.yaml b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/policy.yaml
new file mode 100644
index 0000000000..2136ddd829
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/policy.yaml
@@ -0,0 +1,18 @@
+apiVersion: kyverno.io/v2
+kind: CleanupPolicy
+metadata:
+  name: cleanup-pod
+  namespace: default
+spec:
+  match:
+    any:
+    - resources:
+        kinds:
+          - Pod
+  conditions:
+    any:
+    - key: "{{ target.metadata.name }}"
+      operator: Equals
+      value: example
+  ## execute every minute
+  schedule: "*/1 * * * *"
\ No newline at end of file
diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/rbac.yaml b/test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/rbac.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/policy/cleanup-pod/rbac.yaml
rename to test/conformance/chainsaw/cleanup/v2/policy/cleanup-pod/rbac.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/README.md b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/README.md
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/cron-format/README.md
rename to test/conformance/chainsaw/cleanup/v2/validation/cron-format/README.md
diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/chainsaw-test.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/cron-format/chainsaw-test.yaml
rename to test/conformance/chainsaw/cleanup/v2/validation/cron-format/chainsaw-test.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/cron-format/clusterpolicy.yaml b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/clusterpolicy.yaml
new file mode 100644
index 0000000000..d3d7aa5792
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/clusterpolicy.yaml
@@ -0,0 +1,16 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanuppolicy
+spec:
+  match:
+    any:
+    - resources:
+        kinds:
+          - Pod
+  conditions:
+    any:
+    - key: "{{ target.metadata.name }}"
+      operator: Equals
+      value: example
+  schedule: "*/2 * * * *"
\ No newline at end of file
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/cron-format/invalidpolicy.yaml b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/invalidpolicy.yaml
new file mode 100644
index 0000000000..005cdcd7b0
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/invalidpolicy.yaml
@@ -0,0 +1,17 @@
+apiVersion: kyverno.io/v2
+kind: CleanupPolicy
+metadata:
+  name: cleanuppolicy
+  namespace: default
+spec:
+  match:
+    any:
+    - resources:
+        kinds:
+          - Pod
+  conditions:
+    any:
+    - key: "{{ target.metadata.name }}"
+      operator: Equals
+      value: example
+  schedule: "invalid-schedule"
\ No newline at end of file
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/cron-format/policy.yaml b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/policy.yaml
new file mode 100644
index 0000000000..9f78860135
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/cron-format/policy.yaml
@@ -0,0 +1,17 @@
+apiVersion: kyverno.io/v2
+kind: CleanupPolicy
+metadata:
+  name: cleanuppolicy
+  namespace: default
+spec:
+  match:
+    any:
+    - resources:
+        kinds:
+          - Pod
+  conditions:
+    any:
+    - key: "{{ target.metadata.name }}"
+      operator: Equals
+      value: example
+  schedule: "*/2 * * * *"
\ No newline at end of file
diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/README.md b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/README.md
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/README.md
rename to test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/README.md
diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/chainsaw-test.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/chainsaw-test.yaml
rename to test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/chainsaw-test.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml
new file mode 100644
index 0000000000..e1b42b9f74
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml
@@ -0,0 +1,13 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanuppolicy
+spec:
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+        clusterRoles:
+          - clusteradmin
+  schedule: '* * * * *'
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml
new file mode 100644
index 0000000000..42960def49
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml
@@ -0,0 +1,13 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanuppolicy
+spec:
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+        roles:
+          - admin
+  schedule: '* * * * *'
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml
new file mode 100644
index 0000000000..730434643b
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml
@@ -0,0 +1,14 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanuppolicy
+spec:
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+        subjects:
+          - kind: User
+            name: chip
+  schedule: '* * * * *'
diff --git a/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/chainsaw-test.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/chainsaw-test.yaml
rename to test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/chainsaw-test.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml b/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml
new file mode 100644
index 0000000000..609046c866
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml
@@ -0,0 +1,25 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanup-pod
+spec:
+  context:
+    - name: configData
+      configMap:
+        name: some-config-map
+        namespace: default
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+  conditions:
+    all:
+      - key: "{{ target.metadata.name }}"
+        operator: Equals
+        value: example
+      - key: "{{ target.metadata.namespace }}"
+        operator: Equals
+        value: default
+  ## execute every minute
+  schedule: "*/1 * * * *"
diff --git a/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml b/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml
new file mode 100644
index 0000000000..c64e3f399d
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml
@@ -0,0 +1,24 @@
+apiVersion: kyverno.io/v2
+kind: ClusterCleanupPolicy
+metadata:
+  name: cleanup-pod
+spec:
+  context:
+    - name: imageData
+      imageRegistry:
+        reference: "ghcr.io/kyverno/kyverno"
+  match:
+    any:
+      - resources:
+          kinds:
+            - Pod
+  conditions:
+    all:
+      - key: "{{ target.metadata.name }}"
+        operator: Equals
+        value: "example"
+      - key: "{{ target.metadata.namespace }}"
+        operator: Equals
+        value: default
+  ## execute every minute
+  schedule: "*/1 * * * *"
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/README.md b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/README.md
new file mode 100644
index 0000000000..017a677c05
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/README.md
@@ -0,0 +1,9 @@
+# ## Description
+
+This test cleans up pods via a cluster cleanup policy.
+
+## Expected Behavior
+
+The pod `default/example` is cleaned up successfully.
+
+## Reference Issue(s)
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/chainsaw-test.yaml
new file mode 100755
index 0000000000..a4c2e269ed
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/chainsaw-test.yaml
@@ -0,0 +1,31 @@
+apiVersion: chainsaw.kyverno.io/v1alpha1
+kind: Test
+metadata:
+  creationTimestamp: null
+  name: cleanup-pod
+spec:
+  steps:
+  - name: step-01
+    try:
+    - apply:
+        file: rbac.yaml
+  - name: step-02
+    try:
+    - apply:
+        file: pod.yaml
+    - assert:
+        file: pod-assert.yaml
+  - name: step-03
+    try:
+    - apply:
+        file: policy.yaml
+    - assert:
+        file: policy.yaml
+  - name: step-04
+    try:
+    - sleep:
+        duration: 1m5s
+  - name: step-05
+    try:
+    - error:
+        file: pod-assert.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod-assert.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod-assert.yaml
new file mode 100644
index 0000000000..99bac5fb09
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod-assert.yaml
@@ -0,0 +1,5 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: example
+  namespace: default
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod.yaml
new file mode 100644
index 0000000000..91b8d5074d
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/pod.yaml
@@ -0,0 +1,9 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: example
+  namespace: default
+spec:
+  containers:
+  - image: nginx:latest
+    name: example
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/policy.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/policy.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/cleanup-pod/policy.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/policy.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/rbac.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/rbac.yaml
new file mode 100644
index 0000000000..a9af733222
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/cleanup-pod/rbac.yaml
@@ -0,0 +1,26 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: test-cleanup-pod
+rules:
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  verbs:
+  - delete
+  - list
+  - get
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: test-cleanup-pod
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: test-cleanup-pod
+subjects:
+- kind: ServiceAccount
+  name: kyverno-cleanup-controller
+  namespace: kyverno
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/README.md b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/README.md
new file mode 100644
index 0000000000..d65b6906b9
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/README.md
@@ -0,0 +1,9 @@
+# ## Description
+
+This test cleans up pods via a cluster cleanup policy.
+
+## Expected Behavior
+
+The pod `{{ varname }}` in the namespace `{{ varNamespace }}` set by context variable is cleaned up successfully.
+
+## Reference Issue(s)
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml
new file mode 100755
index 0000000000..7ccab9b705
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/chainsaw-test.yaml
@@ -0,0 +1,27 @@
+apiVersion: chainsaw.kyverno.io/v1alpha1
+kind: Test
+metadata:
+  creationTimestamp: null
+  name: context-cleanup-pod
+spec:
+  steps:
+  - name: step-01
+    try:
+    - apply:
+        file: rbac.yaml
+  - name: step-02
+    try:
+    - apply:
+        file: pod.yaml
+    - assert:
+        file: pod-assert.yaml
+  - name: step-03
+    try:
+    - apply:
+        file: policy.yaml
+    - assert:
+        file: policy.yaml
+  - name: step-05
+    try:
+    - error:
+        file: pod-assert.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod-assert.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod-assert.yaml
new file mode 100644
index 0000000000..99bac5fb09
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod-assert.yaml
@@ -0,0 +1,5 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: example
+  namespace: default
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod.yaml
new file mode 100644
index 0000000000..91b8d5074d
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/pod.yaml
@@ -0,0 +1,9 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: example
+  namespace: default
+spec:
+  containers:
+  - image: nginx:latest
+    name: example
diff --git a/test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/policy.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/policy.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/clusterpolicy/context-cleanup-pod/policy.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/policy.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/rbac.yaml b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/rbac.yaml
new file mode 100644
index 0000000000..a9af733222
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/clusterpolicy/context-cleanup-pod/rbac.yaml
@@ -0,0 +1,26 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: test-cleanup-pod
+rules:
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  verbs:
+  - delete
+  - list
+  - get
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: test-cleanup-pod
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: test-cleanup-pod
+subjects:
+- kind: ServiceAccount
+  name: kyverno-cleanup-controller
+  namespace: kyverno
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/README.md b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/README.md
new file mode 100644
index 0000000000..571352f548
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/README.md
@@ -0,0 +1,10 @@
+# ## Description
+
+This test cleans up pods via a namespaced cleanup policy.
+
+## Expected Behavior
+
+The pod `default/example` is cleaned up successfully.
+
+
+## Reference Issue(s)
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/chainsaw-test.yaml
new file mode 100755
index 0000000000..d0eaa13847
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/chainsaw-test.yaml
@@ -0,0 +1,27 @@
+apiVersion: chainsaw.kyverno.io/v1alpha1
+kind: Test
+metadata:
+  creationTimestamp: null
+  name: cleanup-pod
+spec:
+  steps:
+  - name: step-01
+    try:
+    - apply:
+        file: rbac.yaml
+  - name: step-02
+    try:
+    - apply:
+        file: pod.yaml
+    - assert:
+        file: pod-assert.yaml
+  - name: step-03
+    try:
+    - apply:
+        file: policy.yaml
+    - assert:
+        file: policy.yaml
+  - name: step-05
+    try:
+    - error:
+        file: pod-assert.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod-assert.yaml b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod-assert.yaml
new file mode 100644
index 0000000000..99bac5fb09
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod-assert.yaml
@@ -0,0 +1,5 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: example
+  namespace: default
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod.yaml b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod.yaml
new file mode 100644
index 0000000000..91b8d5074d
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/pod.yaml
@@ -0,0 +1,9 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: example
+  namespace: default
+spec:
+  containers:
+  - image: nginx:latest
+    name: example
diff --git a/test/conformance/chainsaw/cleanup/policy/cleanup-pod/policy.yaml b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/policy.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/policy/cleanup-pod/policy.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/policy.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/rbac.yaml b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/rbac.yaml
new file mode 100644
index 0000000000..a9af733222
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/policy/cleanup-pod/rbac.yaml
@@ -0,0 +1,26 @@
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: test-cleanup-pod
+rules:
+- apiGroups:
+  - ""
+  resources:
+  - pods
+  verbs:
+  - delete
+  - list
+  - get
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: test-cleanup-pod
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: test-cleanup-pod
+subjects:
+- kind: ServiceAccount
+  name: kyverno-cleanup-controller
+  namespace: kyverno
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/README.md b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/README.md
new file mode 100644
index 0000000000..c17eaf07d6
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/README.md
@@ -0,0 +1,4 @@
+## Description
+
+This test creates tries to create two cleanup policies, one with a valid schedule and one with an invalid schedule.
+The creation of the one with the valid schedule is expected to succeed while the one with the invalid schedule is expected to fail.
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/chainsaw-test.yaml
new file mode 100755
index 0000000000..c1b5eb1e07
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/chainsaw-test.yaml
@@ -0,0 +1,26 @@
+apiVersion: chainsaw.kyverno.io/v1alpha1
+kind: Test
+metadata:
+  creationTimestamp: null
+  name: cron-format
+spec:
+  steps:
+  - name: step-01
+    try:
+    - apply:
+        file: policy.yaml
+    - assert:
+        file: policy.yaml
+  - name: step-02
+    try:
+    - apply:
+        file: clusterpolicy.yaml
+    - assert:
+        file: clusterpolicy.yaml
+  - name: step-03
+    try:
+    - apply:
+        expect:
+        - check:
+            ($error != null): true
+        file: invalidpolicy.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/clusterpolicy.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/clusterpolicy.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/cron-format/clusterpolicy.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/clusterpolicy.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/invalidpolicy.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/invalidpolicy.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/cron-format/invalidpolicy.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/invalidpolicy.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/cron-format/policy.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/policy.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/cron-format/policy.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/cron-format/policy.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/README.md b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/README.md
new file mode 100644
index 0000000000..69843ccd6d
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/README.md
@@ -0,0 +1,8 @@
+## Description
+
+This test creates a cleanup policy containing user infos in `match` statement.
+The creation should fail as cleanup policies with user infos are not allowed.
+
+## Steps
+
+1.  - Try create a couple of cleanup policies, expecting the creation to fail because they contain user infos
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/chainsaw-test.yaml
new file mode 100755
index 0000000000..37cc1a70c0
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/chainsaw-test.yaml
@@ -0,0 +1,24 @@
+apiVersion: chainsaw.kyverno.io/v1alpha1
+kind: Test
+metadata:
+  creationTimestamp: null
+  name: no-user-info-in-match
+spec:
+  steps:
+  - name: step-01
+    try:
+    - apply:
+        expect:
+        - check:
+            ($error != null): true
+        file: cleanuppolicy-with-subjects.yaml
+    - apply:
+        expect:
+        - check:
+            ($error != null): true
+        file: cleanuppolicy-with-roles.yaml
+    - apply:
+        expect:
+        - check:
+            ($error != null): true
+        file: cleanuppolicy-with-clusterroles.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/cleanuppolicy-with-clusterroles.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/cleanuppolicy-with-roles.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/no-user-info-in-match/cleanuppolicy-with-subjects.yaml
diff --git a/test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/chainsaw-test.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/chainsaw-test.yaml
new file mode 100755
index 0000000000..a2eebcf270
--- /dev/null
+++ b/test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/chainsaw-test.yaml
@@ -0,0 +1,19 @@
+apiVersion: chainsaw.kyverno.io/v1alpha1
+kind: Test
+metadata:
+  creationTimestamp: null
+  name: not-supported-attributes-in-context
+spec:
+  steps:
+  - name: step-01
+    try:
+    - apply:
+        expect:
+        - check:
+            ($error != null): true
+        file: cleanuppolicy-with-image-registry.yaml
+    - apply:
+        expect:
+        - check:
+            ($error != null): true
+        file: cleanuppolicy-with-configmap.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/cleanuppolicy-with-configmap.yaml
diff --git a/test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml b/test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml
similarity index 100%
rename from test/conformance/chainsaw/cleanup/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml
rename to test/conformance/chainsaw/cleanup/v2beta1/validation/not-supported-attributes-in-context/cleanuppolicy-with-image-registry.yaml