1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

chore: run rbac testsuite using chainsaw (#8950)

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
Mariam Fahmy 2023-11-20 01:53:48 +02:00 committed by GitHub
parent 765bd198f1
commit 569b50c069
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 2 deletions

View file

@ -178,7 +178,6 @@ jobs:
version: v1.28.0
tests:
# - autogen
# - background-only
# - cleanup
# - deferred
# - events
@ -190,13 +189,13 @@ jobs:
# - mutate
# - policy-validation
# - rangeoperators
# - rbac
# - reports
# - validate
# - verify-manifests
# - verifyImages
- webhooks
- background-only
- rbac
needs: prepare-images
name: chainsaw - ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
steps:

View file

@ -0,0 +1,14 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
name: rbac
spec:
try:
- assert:
file: admin-policies.yaml
- assert:
file: admin-policyreport.yaml
- assert:
file: admin-reports.yaml
- assert:
file: admin-updaterequest.yaml

View file

@ -0,0 +1,3 @@
## Description
This test verifies that kyverno admin cluster roles exist in the cluster and are labelled correctly to be aggregated to the `admin` cluster role.

View file

@ -0,0 +1,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno:rbac:admin:policies
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
- kyverno.io
resources:
- cleanuppolicies
- clustercleanuppolicies
- policies
- clusterpolicies
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

View file

@ -0,0 +1,20 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno:rbac:admin:policyreports
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
- wgpolicyk8s.io
resources:
- policyreports
- clusterpolicyreports
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

View file

@ -0,0 +1,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno:rbac:admin:reports
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
- kyverno.io
resources:
- admissionreports
- clusteradmissionreports
- backgroundscanreports
- clusterbackgroundscanreports
verbs:
- create
- delete
- get
- list
- patch
- update
- watch

View file

@ -0,0 +1,19 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno:rbac:admin:updaterequests
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
- kyverno.io
resources:
- updaterequests
verbs:
- create
- delete
- get
- list
- patch
- update
- watch