From 52971c372a18054239cf1f84b8bd73c9c9ac0c23 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 17:29:53 +0200 Subject: [PATCH] fix: generate/validation kuttl tests (#8085) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- ...-update-clusterrole.yaml => 02-clusterrole.yaml} | 2 +- .../permissions/no-permission/06-delete.yaml | 6 ------ ...-update-clusterrole.yaml => 01-clusterrole.yaml} | 13 ------------- .../target-namespace-scope/03-delete.yaml | 6 ------ .../target-namespace-scope/04-delete.yaml | 6 ------ ...-update-clusterrole.yaml => 03-clusterrole.yaml} | 2 +- .../validation/policy/permissions/05-delete.yaml | 6 ------ 7 files changed, 2 insertions(+), 39 deletions(-) rename test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/{02-update-clusterrole.yaml => 02-clusterrole.yaml} (87%) delete mode 100644 test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/06-delete.yaml rename test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/{01-update-clusterrole.yaml => 01-clusterrole.yaml} (61%) delete mode 100644 test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/03-delete.yaml delete mode 100644 test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/04-delete.yaml rename test/conformance/kuttl/generate/validation/policy/permissions/{03-update-clusterrole.yaml => 03-clusterrole.yaml} (87%) delete mode 100644 test/conformance/kuttl/generate/validation/policy/permissions/05-delete.yaml diff --git a/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/02-update-clusterrole.yaml b/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/02-clusterrole.yaml similarity index 87% rename from test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/02-update-clusterrole.yaml rename to test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/02-clusterrole.yaml index df4884f5e5..b7cc486047 100644 --- a/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/02-update-clusterrole.yaml +++ b/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/02-clusterrole.yaml @@ -1,7 +1,7 @@ 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 diff --git a/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/06-delete.yaml b/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/06-delete.yaml deleted file mode 100644 index 67d9ba2b9b..0000000000 --- a/test/conformance/kuttl/generate/validation/clusterpolicy/permissions/no-permission/06-delete.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -delete: -- apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - name: kyverno:background-controller:additional diff --git a/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/01-update-clusterrole.yaml b/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/01-clusterrole.yaml similarity index 61% rename from test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/01-update-clusterrole.yaml rename to test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/01-clusterrole.yaml index 5169a077c9..2d6cd750d3 100644 --- a/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/01-update-clusterrole.yaml +++ b/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/01-clusterrole.yaml @@ -27,16 +27,3 @@ rules: - update - delete - get ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: kyverno:manage-ns-crossplane-role -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: kyverno:background-controller:manage-ns-crossplane-role -subjects: -- kind: ServiceAccount - name: kyverno-background-controller - namespace: kyverno \ No newline at end of file diff --git a/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/03-delete.yaml b/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/03-delete.yaml deleted file mode 100644 index a728371431..0000000000 --- a/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/03-delete.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -delete: -- apiVersion: apiextensions.k8s.io/v1 - kind: CustomResourceDefinition - name: roles.iam.aws.crossplane.io diff --git a/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/04-delete.yaml b/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/04-delete.yaml deleted file mode 100644 index 67d9ba2b9b..0000000000 --- a/test/conformance/kuttl/generate/validation/clusterpolicy/target-namespace-scope/04-delete.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -delete: -- apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - name: kyverno:background-controller:additional diff --git a/test/conformance/kuttl/generate/validation/policy/permissions/03-update-clusterrole.yaml b/test/conformance/kuttl/generate/validation/policy/permissions/03-clusterrole.yaml similarity index 87% rename from test/conformance/kuttl/generate/validation/policy/permissions/03-update-clusterrole.yaml rename to test/conformance/kuttl/generate/validation/policy/permissions/03-clusterrole.yaml index df4884f5e5..b7cc486047 100644 --- a/test/conformance/kuttl/generate/validation/policy/permissions/03-update-clusterrole.yaml +++ b/test/conformance/kuttl/generate/validation/policy/permissions/03-clusterrole.yaml @@ -1,7 +1,7 @@ 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 diff --git a/test/conformance/kuttl/generate/validation/policy/permissions/05-delete.yaml b/test/conformance/kuttl/generate/validation/policy/permissions/05-delete.yaml deleted file mode 100644 index 67d9ba2b9b..0000000000 --- a/test/conformance/kuttl/generate/validation/policy/permissions/05-delete.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -delete: -- apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - name: kyverno:background-controller:additional