Repository navigation
Conversation
PR Summary by QodoFix OLM v1 installer RBAC and prevent bundle permission drift
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
View medium (2)🟠 **Medium** 1. Bundle role edits bypass the RBAC check
|
|
Important The |
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
ad1d1d8 to
e6cf8eb
Compare
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
prepare-restricted-environment.sh renders an installer ClusterRole for the
OLM v1 path. OLM installs the bundle with that ServiceAccount, and the API
server refuses to create RBAC that grants permissions the installer does not
hold itself ("attempting to grant RBAC permissions not currently held").
The role was not updated when the operator gained access to pods, apiservers,
ingresses and the DevHubPluginCatalog CRD, so OLM v1 installs fail with:
failed to create resource: clusterroles.rbac.authorization.k8s.io
"rhdh-operator.v2.2-..." is forbidden: ... attempting to grant RBAC
permissions not currently held: {pods}, {apiservers}, {ingresses},
{devhubplugincatalogs}, {devhubplugincatalogs/status}
The Helm release fails halfway: the CRD, the Deployment and the
ClusterRoleBinding are created, so the operator pod runs without any
permissions and reports "forbidden" for every resource it watches.
Add the missing rules, and a check (make check-installer-rbac) that compares
the installer role with the bundle CSV and the ClusterRoles shipped in the
bundle so they cannot drift again.
Assisted-by: OpenCode
e6cf8eb to
0203abf
Compare
|
|
✅ PR images built and pushed successfully! Images are available for testing (expires in 7 days):
|
|
Replaced with #3927 |



Description
OLM v1 installs a bundle with a dedicated installer ServiceAccount, and the API server refuses to create RBAC that grants permissions the installer does not hold itself. The installer ClusterRole rendered by
prepare-restricted-environment.shwas not updated when the operator gained access to pods, apiservers/ingresses and the DevHubPluginCatalog CRD, so the OLM v1 path fails with:The Helm release then fails halfway: the CRD, the Deployment and the ClusterRoleBinding exist, so the operator pod runs without any permissions and reports
forbiddenfor every resource it watches.This adds the missing rules and
make check-installer-rbac, which compares the installer ClusterRole with the bundle CSV and the ClusterRoles shipped in the bundle, so the two cannot drift again. The check fails on the currentmainand passes with the fix.Which issue(s) does this PR fix or relate to
Jira: https://redhat.atlassian.net/browse/RHDHBUGS-4056
Found while fixing the RHDH disconnected OCP nightly jobs: redhat-developer/rhdh#5709
Backport of #3923.
PR acceptance criteria
How to test changes / Special notes to the reviewer
On
mainit reports the 14 missing permissions; with this PR it passes.