Skip to content

Commit 7f056e6

Browse files
authored
Add deletecollection permission into role (#91)
* Add deletecollection permission into role * Add deletecollection into clusterrole
1 parent 470e645 commit 7f056e6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bundle/manifests/ibm-namespace-scope-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ spec:
6161
- patch
6262
- update
6363
- watch
64+
- deletecollection
6465
- apiGroups:
6566
- rbac.authorization.k8s.io
6667
resources:

controllers/namespacescope_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ func (r *NamespaceScopeReconciler) createRoleForNSS(labels map[string]string, fr
369369
},
370370
Rules: []rbacv1.PolicyRule{
371371
{
372-
Verbs: []string{"create", "delete", "get", "list", "patch", "update", "watch"},
372+
Verbs: []string{"create", "delete", "get", "list", "patch", "update", "watch", "deletecollection"},
373373
APIGroups: []string{"*"},
374374
Resources: []string{"*"},
375375
},
@@ -797,7 +797,7 @@ func (r *NamespaceScopeReconciler) checkGetNSAuth() bool {
797797

798798
// Check if operator has namespace admin permission
799799
func (r *NamespaceScopeReconciler) checkNamespaceAdminAuth(namespace string) bool {
800-
verbs := []string{"create", "delete", "get", "list", "patch", "update", "watch"}
800+
verbs := []string{"create", "delete", "get", "list", "patch", "update", "watch", "deletecollection"}
801801
for _, verb := range verbs {
802802
sar := &authorizationv1.SelfSubjectAccessReview{
803803
Spec: authorizationv1.SelfSubjectAccessReviewSpec{

0 commit comments

Comments
 (0)