Skip to content

Commit e70dfb7

Browse files
committed
controller: add pvc finalizer rbac for annotation controller
Running pvc annotation controller on openshift throws the following error. ``` "reclaimspacecronjobs.csiaddons.openshift.io \"pvcrbd10-1643271677\" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , <nil>" ``` Adding pvc finalizer rbac solves this issue. Signed-off-by: Rakshith R <rar@redhat.com> (cherry picked from commit b6c48cf)
1 parent de4524b commit e70dfb7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config/rbac/role.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ rules:
3030
- list
3131
- patch
3232
- watch
33+
- apiGroups:
34+
- ""
35+
resources:
36+
- persistentvolumeclaims/finalizers
37+
verbs:
38+
- update
3339
- apiGroups:
3440
- csiaddons.openshift.io
3541
resources:

controllers/persistentvolumeclaim_controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const (
5555
)
5656

5757
//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=get;list;watch;patch
58+
//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaims/finalizers,verbs=update
5859
//+kubebuilder:rbac:groups=csiaddons.openshift.io,resources=reclaimspacecronjobs,verbs=get;list;watch;create;delete;update
5960

6061
// Reconcile is part of the main kubernetes reconciliation loop which aims to

0 commit comments

Comments
 (0)