Skip to content

Remove unnecessary RBAC verbs#29

Open
lpiwowar wants to merge 1 commit into
openstack-k8s-operators:mainfrom
lpiwowar:lpiwowar/OSPRH-30842
Open

Remove unnecessary RBAC verbs#29
lpiwowar wants to merge 1 commit into
openstack-k8s-operators:mainfrom
lpiwowar:lpiwowar/OSPRH-30842

Conversation

@lpiwowar

@lpiwowar lpiwowar commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Applied principle of least privilege across all RBAC markers in openstacklightspeed_controller.go. Verbs were removed where code analysis confirmed they are never exercised by the controller or the controller-runtime framework.

ClusterRole changes:

  • openstacklightspeeds: removed create, delete, update; get/list/watch/patch are sufficient for normal reconciliation
  • openstacklightspeeds/status: removed get, update; only patch is needed to update the status subresource
  • clusterroles: removed update, delete; CreateOrPatch uses get/create/patch, bulk removal uses deletecollection (DeleteAllOf)
  • clusterrolebindings: same reasoning as clusterroles
  • clusterversions: removed watch only; list is retained because the operator grants list to the app-server SAR ClusterRole and cannot grant permissions it does not hold
  • consoleplugins: removed update; get/list/watch/create/patch/delete cover all actual operations

Role (namespaced) changes:

  • clusterserviceversions: removed patch; only update and delete are needed for owner reference and uninstall
  • networkpolicies: removed update; CreateOrPatch uses get/create/patch; owned resources are GC'd by Kubernetes
  • deployments: removed update, delete; CreateOrPatch uses get/create/patch; owned resources are GC'd by Kubernetes
  • configmaps: removed update; get/list/watch/create/patch/delete cover all actual operations (one ConfigMap is explicitly deleted on toggle)
  • secrets: removed update, delete; bulk removal uses deletecollection (DeleteAllOf); owned secrets are GC'd by Kubernetes
  • services: removed update, delete; CreateOrPatch uses get/create/patch; owned resources are GC'd by Kubernetes
  • persistentvolumeclaims: removed update; get/list/watch/create/patch cover all actual operations; PVCs are intentionally never deleted

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lpiwowar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lpiwowar

Copy link
Copy Markdown
Collaborator Author

/test all

Applied principle of least privilege across all RBAC markers in
openstacklightspeed_controller.go. Verbs were removed where code
analysis confirmed they are never exercised by the controller or
the controller-runtime framework.

ClusterRole changes:
- openstacklightspeeds: removed create, delete, update; get, list,
  watch, patch are sufficient for normal reconciliation
- openstacklightspeeds/status: removed get, update; only patch is
  needed to update the status subresource
- clusterroles: removed update, delete; CreateOrPatch uses
  get/create/patch, bulk removal uses deletecollection (DeleteAllOf)
- clusterrolebindings: same reasoning as clusterroles
- clusterversions: removed watch only; list is retained because the
  operator grants list to the app-server SAR ClusterRole and cannot
  grant permissions it does not hold
- consoleplugins: removed update; get/list/watch/create/patch/delete
  cover all actual operations

Role (namespaced) changes:
- clusterserviceversions: removed patch; only update and delete are
  needed for owner reference and uninstall
- networkpolicies: removed update; CreateOrPatch uses get/create/patch
- deployments: removed update, delete; CreateOrPatch uses
  get/create/patch; owned resources are GC'd by Kubernetes
- configmaps: removed update; get/list/watch/create/patch/delete cover
  all actual operations (one ConfigMap is explicitly deleted on toggle)
- secrets: removed update, delete; bulk removal uses deletecollection
  (DeleteAllOf); owned secrets are GC'd by Kubernetes
- services: removed update, delete; CreateOrPatch uses
  get/create/patch; owned resources are GC'd by Kubernetes
- persistentvolumeclaims: removed update; get/list/watch/create/patch
  cover all actual operations; PVCs are intentionally never deleted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lpiwowar
lpiwowar force-pushed the lpiwowar/OSPRH-30842 branch from 3499f12 to 88d1e3a Compare July 21, 2026 16:26
@lpiwowar

Copy link
Copy Markdown
Collaborator Author

/test all

@lpiwowar

Copy link
Copy Markdown
Collaborator Author

/hold

I'm waiting for this PR to get merged. I do not want to cause any more merge conflicts -> #19

@lpiwowar
lpiwowar marked this pull request as ready for review July 22, 2026 12:25
@openshift-ci
openshift-ci Bot requested review from Akrog and umago July 22, 2026 12:25
@lpiwowar

Copy link
Copy Markdown
Collaborator Author

/test openstack-lightspeed-kuttl-4-20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant