From 11ef5758e48cddb40019837d0bd5187a625cdb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 22 Aug 2023 18:50:26 +0200 Subject: [PATCH] fix: mutate existing kuttl tests (#8088) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- ...e-clusterrole.yaml => 02-clusterrole.yaml} | 6 +++- .../04-reset-clusterrole.yaml | 27 ------------------ ...e-clusterrole.yaml => 03-clusterrole.yaml} | 6 +++- .../auth-check/05-reset-clusterrole.yaml | 27 ------------------ ...e-clusterrole.yaml => 00-clusterrole.yaml} | 6 +++- .../02-reset-update-clusterrole.yaml | 28 ------------------- 6 files changed, 15 insertions(+), 85 deletions(-) rename test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/{02-update-clusterrole.yaml => 02-clusterrole.yaml} (51%) delete mode 100644 test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/04-reset-clusterrole.yaml rename test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/{03-update-clusterrole.yaml => 03-clusterrole.yaml} (51%) delete mode 100644 test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/05-reset-clusterrole.yaml rename test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/{00-update-clusterrole.yaml => 00-clusterrole.yaml} (50%) delete mode 100644 test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/02-reset-update-clusterrole.yaml diff --git a/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/02-update-clusterrole.yaml b/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/02-clusterrole.yaml similarity index 51% rename from test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/02-update-clusterrole.yaml rename to test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/02-clusterrole.yaml index abefce0036..b7cc486047 100644 --- a/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/02-update-clusterrole.yaml +++ b/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/02-clusterrole.yaml @@ -1,7 +1,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kyverno:background-controller:additional + name: kyverno:background-controller:temp + labels: + app.kubernetes.io/component: background-controller + app.kubernetes.io/instance: kyverno + app.kubernetes.io/part-of: kyverno rules: - apiGroups: - '*' diff --git a/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/04-reset-clusterrole.yaml b/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/04-reset-clusterrole.yaml deleted file mode 100644 index 379b55efeb..0000000000 --- a/test/conformance/kuttl/mutate/clusterpolicy/standard/existing/validation/auth-check/cpol-standard-auth-check/04-reset-clusterrole.yaml +++ /dev/null @@ -1,27 +0,0 @@ -## reset changed clusterrole for the rest of the tests -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kyverno:background-controller:additional -rules: -- apiGroups: - - '*' - resources: - - configmaps - - networkpolicies - - resourcequotas - - secrets - - roles - - rolebindings - - limitranges - - namespaces - - nodes - - nodes/status - - pods - verbs: - - create - - update - - patch - - delete - - get - - list \ No newline at end of file diff --git a/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/03-update-clusterrole.yaml b/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/03-clusterrole.yaml similarity index 51% rename from test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/03-update-clusterrole.yaml rename to test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/03-clusterrole.yaml index abefce0036..b7cc486047 100644 --- a/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/03-update-clusterrole.yaml +++ b/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/03-clusterrole.yaml @@ -1,7 +1,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kyverno:background-controller:additional + name: kyverno:background-controller:temp + labels: + app.kubernetes.io/component: background-controller + app.kubernetes.io/instance: kyverno + app.kubernetes.io/part-of: kyverno rules: - apiGroups: - '*' diff --git a/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/05-reset-clusterrole.yaml b/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/05-reset-clusterrole.yaml deleted file mode 100644 index 379b55efeb..0000000000 --- a/test/conformance/kuttl/mutate/policy/standard/existing/validation/auth-check/05-reset-clusterrole.yaml +++ /dev/null @@ -1,27 +0,0 @@ -## reset changed clusterrole for the rest of the tests -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kyverno:background-controller:additional -rules: -- apiGroups: - - '*' - resources: - - configmaps - - networkpolicies - - resourcequotas - - secrets - - roles - - rolebindings - - limitranges - - namespaces - - nodes - - nodes/status - - pods - verbs: - - create - - update - - patch - - delete - - get - - list \ No newline at end of file diff --git a/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/00-update-clusterrole.yaml b/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/00-clusterrole.yaml similarity index 50% rename from test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/00-update-clusterrole.yaml rename to test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/00-clusterrole.yaml index 5cd4452aba..b094e55fb2 100644 --- a/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/00-update-clusterrole.yaml +++ b/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/00-clusterrole.yaml @@ -1,7 +1,11 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: kyverno:background-controller:additional + name: kyverno:background-controller:temp + labels: + app.kubernetes.io/component: background-controller + app.kubernetes.io/instance: kyverno + app.kubernetes.io/part-of: kyverno rules: - apiGroups: - '*' diff --git a/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/02-reset-update-clusterrole.yaml b/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/02-reset-update-clusterrole.yaml deleted file mode 100644 index e5df8b4024..0000000000 --- a/test/conformance/kuttl/validate/clusterpolicy/cornercases/schema-validation-for-mutateExisting/02-reset-update-clusterrole.yaml +++ /dev/null @@ -1,28 +0,0 @@ -## reset changed clusterrole for the rest of the tests -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kyverno:background-controller:additional -rules: -- apiGroups: - - '*' - resources: - - configmaps - - networkpolicies - - resourcequotas - - secrets - - roles - - rolebindings - - limitranges - - namespaces - - nodes - - nodes/status - - pods - - deployments - verbs: - - create - - update - - patch - - delete - - get - - list \ No newline at end of file