Skip to content

Commit 13596e5

Browse files
committed
Remove obsolete CSI RBAC roles
1 parent 2905275 commit 13596e5

File tree

2 files changed

+0
-139
lines changed

2 files changed

+0
-139
lines changed

plugin/pkg/auth/authorizer/rbac/bootstrappolicy/policy.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,6 @@ func ClusterRoles() []rbacv1.ClusterRole {
428428
eventsRule(),
429429
},
430430
},
431-
{
432-
// a role for the csi external attacher
433-
ObjectMeta: metav1.ObjectMeta{Name: "system:csi-external-attacher"},
434-
Rules: []rbacv1.PolicyRule{
435-
rbacv1helpers.NewRule("get", "list", "watch", "update", "patch").Groups(legacyGroup).Resources("persistentvolumes").RuleOrDie(),
436-
rbacv1helpers.NewRule("get", "list", "watch").Groups(legacyGroup).Resources("nodes").RuleOrDie(),
437-
rbacv1helpers.NewRule("get", "list", "watch", "update", "patch").Groups(storageGroup).Resources("volumeattachments").RuleOrDie(),
438-
rbacv1helpers.NewRule("get", "list", "watch", "create", "update", "patch").Groups(legacyGroup).Resources("events").RuleOrDie(),
439-
},
440-
},
441431
{
442432
// a role making the csrapprover controller approve a node client CSR
443433
ObjectMeta: metav1.ObjectMeta{Name: "system:certificates.k8s.io:certificatesigningrequests:nodeclient"},
@@ -510,22 +500,6 @@ func ClusterRoles() []rbacv1.ClusterRole {
510500
Rules: kubeSchedulerRules,
511501
})
512502

513-
externalProvisionerRules := []rbacv1.PolicyRule{
514-
rbacv1helpers.NewRule("create", "delete", "get", "list", "watch").Groups(legacyGroup).Resources("persistentvolumes").RuleOrDie(),
515-
rbacv1helpers.NewRule("get", "list", "watch", "update", "patch").Groups(legacyGroup).Resources("persistentvolumeclaims").RuleOrDie(),
516-
rbacv1helpers.NewRule("list", "watch").Groups(storageGroup).Resources("storageclasses").RuleOrDie(),
517-
rbacv1helpers.NewRule("get", "list", "watch", "create", "update", "patch").Groups(legacyGroup).Resources("events").RuleOrDie(),
518-
rbacv1helpers.NewRule("get", "list", "watch").Groups(legacyGroup).Resources("nodes").RuleOrDie(),
519-
}
520-
if utilfeature.DefaultFeatureGate.Enabled(features.CSINodeInfo) {
521-
externalProvisionerRules = append(externalProvisionerRules, rbacv1helpers.NewRule("get", "watch", "list").Groups("storage.k8s.io").Resources("csinodes").RuleOrDie())
522-
}
523-
roles = append(roles, rbacv1.ClusterRole{
524-
// a role for the csi external provisioner
525-
ObjectMeta: metav1.ObjectMeta{Name: "system:csi-external-provisioner"},
526-
Rules: externalProvisionerRules,
527-
})
528-
529503
addClusterRoleLabel(roles)
530504
return roles
531505
}

plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/cluster-roles.yaml

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -419,119 +419,6 @@ items:
419419
- certificatesigningrequests/selfnodeclient
420420
verbs:
421421
- create
422-
- apiVersion: rbac.authorization.k8s.io/v1
423-
kind: ClusterRole
424-
metadata:
425-
annotations:
426-
rbac.authorization.kubernetes.io/autoupdate: "true"
427-
creationTimestamp: null
428-
labels:
429-
kubernetes.io/bootstrapping: rbac-defaults
430-
name: system:csi-external-attacher
431-
rules:
432-
- apiGroups:
433-
- ""
434-
resources:
435-
- persistentvolumes
436-
verbs:
437-
- get
438-
- list
439-
- patch
440-
- update
441-
- watch
442-
- apiGroups:
443-
- ""
444-
resources:
445-
- nodes
446-
verbs:
447-
- get
448-
- list
449-
- watch
450-
- apiGroups:
451-
- storage.k8s.io
452-
resources:
453-
- volumeattachments
454-
verbs:
455-
- get
456-
- list
457-
- patch
458-
- update
459-
- watch
460-
- apiGroups:
461-
- ""
462-
resources:
463-
- events
464-
verbs:
465-
- create
466-
- get
467-
- list
468-
- patch
469-
- update
470-
- watch
471-
- apiVersion: rbac.authorization.k8s.io/v1
472-
kind: ClusterRole
473-
metadata:
474-
annotations:
475-
rbac.authorization.kubernetes.io/autoupdate: "true"
476-
creationTimestamp: null
477-
labels:
478-
kubernetes.io/bootstrapping: rbac-defaults
479-
name: system:csi-external-provisioner
480-
rules:
481-
- apiGroups:
482-
- ""
483-
resources:
484-
- persistentvolumes
485-
verbs:
486-
- create
487-
- delete
488-
- get
489-
- list
490-
- watch
491-
- apiGroups:
492-
- ""
493-
resources:
494-
- persistentvolumeclaims
495-
verbs:
496-
- get
497-
- list
498-
- patch
499-
- update
500-
- watch
501-
- apiGroups:
502-
- storage.k8s.io
503-
resources:
504-
- storageclasses
505-
verbs:
506-
- list
507-
- watch
508-
- apiGroups:
509-
- ""
510-
resources:
511-
- events
512-
verbs:
513-
- create
514-
- get
515-
- list
516-
- patch
517-
- update
518-
- watch
519-
- apiGroups:
520-
- ""
521-
resources:
522-
- nodes
523-
verbs:
524-
- get
525-
- list
526-
- watch
527-
- apiGroups:
528-
- storage.k8s.io
529-
resources:
530-
- csinodes
531-
verbs:
532-
- get
533-
- list
534-
- watch
535422
- apiVersion: rbac.authorization.k8s.io/v1
536423
kind: ClusterRole
537424
metadata:

0 commit comments

Comments
 (0)