Skip to content

Commit

Permalink
chore: add permissions to the admission controller
Browse files Browse the repository at this point in the history
Signed-off-by: ShutingZhao <[email protected]>
  • Loading branch information
realshuting committed Aug 29, 2024
1 parent a81a702 commit 1e94301
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
18 changes: 18 additions & 0 deletions scripts/config/standard/kyverno.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ features:
omitEvents:
eventTypes: []

admissionController:
extraArgs:
v: 4
rbac:
clusterRole:
extraResources:
- apiGroups:
- '*'
resources:
- secrets
verbs:
- create
- update
- patch
- delete
- get
- list

backgroundController:
extraArgs:
v: 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ spec:
- foreach-cpol-clone-list-sync-delete-source-target-ns-1
apiVersion: v1
kind: Secret
name: cloned-secret-{{ elementIndex }}-{{ ns }}
namespace: '{{ ns }}'
cloneList:
kinds:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Description

This is a corner case test to ensure the corresponding downstream target is deleted when its trigger is deleted, for a generate cloneList type of policy.
This test ensures the corresponding downstream target is deleted when its trigger is deleted, for a generate foreach cloneList type of policy.

## Expected Behavior

If the downstream resources `mysecret-1` and `mysecret-2` are remained in the namespace `cpol-clone-list-sync-delete-source-trigger-ns-2`, the test passes. If not, the test fails.
If the downstream resources `mysecret-1` is remained in the namespace `cpol-clone-list-sync-delete-source-trigger-ns-1`, the test fails. If not, the test passes.

## Reference Issue(s)

https://github.com/kyverno/kyverno/issues/7535
https://github.com/kyverno/kyverno/issues/3542

0 comments on commit 1e94301

Please sign in to comment.