Skip to content

Commit 93f23ec

Browse files
authored
Merge pull request #65 from Kuadrant/fix-apikeyapproval-ownerref
Add finalizers permission for APIKeyRequest owner references
2 parents 1bb2539 + 9682856 commit 93f23ec

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

config/rbac/role.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ rules:
3939
- get
4040
- patch
4141
- update
42+
- apiGroups:
43+
- devportal.kuadrant.io
44+
resources:
45+
- apikeyrequests/finalizers
46+
verbs:
47+
- update
4248
- apiGroups:
4349
- devportal.kuadrant.io
4450
resources:

internal/controller/apikeyapproval_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type APIKeyApprovalReconciler struct {
4040

4141
// +kubebuilder:rbac:groups=devportal.kuadrant.io,resources=apikeyapprovals,verbs=get;list;watch;update;patch;delete
4242
// +kubebuilder:rbac:groups=devportal.kuadrant.io,resources=apikeyrequests,verbs=get;list;watch
43+
// +kubebuilder:rbac:groups=devportal.kuadrant.io,resources=apikeyrequests/finalizers,verbs=update
4344

4445
// Reconcile handles reconciling all APIKeyApprovals in a single call. Any resource event should enqueue the
4546
// same reconcile.Request containing this controller name, i.e. "apikeyapproval". This allows multiple resource updates to
@@ -124,7 +125,6 @@ func (r *APIKeyApprovalReconciler) reconcileOwnerReference(ctx context.Context,
124125

125126
// Update the APIKeyApproval with the owner reference
126127
if err := r.Update(ctx, approval); err != nil {
127-
logger.Error(err, "Failed to update APIKeyApproval with owner reference")
128128
return err
129129
}
130130

0 commit comments

Comments
 (0)