Skip to content

OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage#331

Open
oribon wants to merge 1 commit into
openshift:mainfrom
oribon:wip_test_ci
Open

OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage#331
oribon wants to merge 1 commit into
openshift:mainfrom
oribon:wip_test_ci

Conversation

@oribon

@oribon oribon commented Jun 14, 2026

Copy link
Copy Markdown

Is this a BUG FIX or a FEATURE ?:

Uncomment only one, leave it on its own line:

/kind bug
/kind cleanup
/kind feature
/kind design
/kind flake
/kind failing
/kind documentation
/kind regression

What this PR does / why we need it:

Special notes for your reviewer:

Release note:


Summary by CodeRabbit

Release Notes

  • Chores
    • Updated MetalLB operator role-based access control to consolidate and refine permissions for the manager service account, expanding access for MetalLB resources and required monitoring, networking, and cluster configuration objects.
    • Further adjusted permissions for the speaker service account by removing access to the privileged SecurityContextConstraints and refining PodSecurityPolicy usage to be scoped specifically to the speaker resource.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 14, 2026
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Walkthrough

The ClusterServiceVersion manifest's install.spec.clusterPermissions is restructured: the frr-k8s-daemon service account RBAC block is narrowed to webhook-only management, manager-account gains expanded cluster permissions across multiple API groups and core resources, and the speaker account swaps its OpenShift SCC privileged rule for a scoped policy podsecuritypolicies use rule. Net change is 119 lines deleted.

Changes

RBAC Permissions Restructuring

Layer / File(s) Summary
frr-k8s-daemon RBAC narrowing
manifests/stable/metallb-operator.clusterserviceversion.yaml
Reduces frr-k8s-daemon clusterPermissions from broad node/FRR resource/auth review access to exclusive management of the frr-k8s-validating-webhook-configuration (delete/get/patch/update/list).
manager-account expansion and speaker permissions update
manifests/stable/metallb-operator.clusterserviceversion.yaml
Expands manager-account with CRUD for core resources (configmaps, events, services, daemonsets, deployments, leases) and pod delete/list. Removes speaker's securitycontextconstraints privileged rule and adds scoped podsecuritypolicies use permission.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely empty, containing only the standard template with no substantive content filled in any required sections. Complete all required sections: specify the PR kind, explain what changes are being made and why they are necessary, add special notes for reviewers, and provide a release note or mark as NONE.
Test Structure And Quality ⚠️ Warning Ginkgo tests fail quality requirements: (1) Single responsibility violated—the test "Should create manifests with images and namespace overriden" checks image templating, node selectors, and tolera... Add diagnostic messages to all Expect statements and split multi-behavior tests into separate, focused test cases testing one specific behavior each.
✅ Passed checks (13 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All Ginkgo test names in the PR are stable and deterministic. Test titles use static, descriptive strings ("Should create manifests for frr-k8s", "Should switch between modes", etc.) with no dynami...
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests were added in this PR. The PR only modifies YAML manifests for RBAC configuration, so the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR contains only YAML manifest RBAC changes; no new Ginkgo e2e tests are added. The SNO compatibility check only applies to new tests.
Topology-Aware Scheduling Compatibility ✅ Passed Changes are RBAC-only (ClusterPermissions in CSV) with no modifications to pod scheduling constraints, affinity rules, topology spread constraints, or replica counts. No topology-aware scheduling i...
Ote Binary Stdout Contract ✅ Passed PR uses ctrl.SetLogger(zap.New(...)) in main() with no fmt.Print* or direct stdout writes in process-level code; test suite uses GinkgoWriter correctly for stdout capture.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only modifies a Kubernetes manifest file (ClusterServiceVersion YAML) with RBAC rules; no new Ginkgo e2e tests were added, so the IPv6/disconnected network check does not apply.
No-Weak-Crypto ✅ Passed PR contains only RBAC permission modifications in YAML manifest files with no cryptographic code changes, weak algorithms, custom crypto implementations, or insecure comparisons.
Container-Privileges ✅ Passed No privileged container settings, hostPID/Network/IPC, SYS_ADMIN capabilities, or allowPrivilegeEscalation found in manifests. PR removes unnecessary permissions per commit message.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements exposing passwords, tokens, API keys, PII, or other sensitive data were found. Container args use only --log-level=info, and environment variables with security configurations...
Title check ✅ Passed The title clearly and specifically describes the main change: reducing OpenShift operator RBAC permissions to match actual usage, which aligns with the detailed RBAC modifications documented in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci openshift-ci Bot requested review from dougbtv and fedepaol June 14, 2026 12:26
@openshift-ci

openshift-ci Bot commented Jun 14, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oribon

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 14, 2026
@oribon oribon force-pushed the wip_test_ci branch 4 times, most recently from 3a88e0c to b239c6c Compare June 17, 2026 10:53
The operator CSV grants permissions the operator never uses on
OpenShift. Trim them down:

- Remove cluster-wide secrets CRUD from manager-account. Cert rotation
  is disabled on OpenShift and service-ca handles TLS secrets.

- Scope webhook config permissions to only the frr-k8s webhook name
  (needed for cleanup) plus read-only list/watch. Was unrestricted CRUD.

- Remove all frr-k8s-daemon SA RBAC. CNO manages frr-k8s on OpenShift,
  operator never deploys it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ori Braunshtein <obraunsh@redhat.com>
@oribon

oribon commented Jun 17, 2026

Copy link
Copy Markdown
Author

/retest

1 similar comment
@oribon

oribon commented Jun 23, 2026

Copy link
Copy Markdown
Author

/retest

@oribon oribon changed the title WIP: TEST CI OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage Jun 23, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 23, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Jun 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@oribon: This pull request references Jira Issue OCPBUGS-91651, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Is this a BUG FIX or a FEATURE ?:

Uncomment only one, leave it on its own line:

/kind bug
/kind cleanup
/kind feature
/kind design
/kind flake
/kind failing
/kind documentation
/kind regression

What this PR does / why we need it:

Special notes for your reviewer:

Release note:


Summary by CodeRabbit

Release Notes

  • Chores
  • Updated MetalLB operator role-based access control to consolidate and refine permissions for the manager service account, expanding access for MetalLB resources and required monitoring, networking, and cluster configuration objects.
  • Further adjusted permissions for the speaker service account by removing access to the privileged SecurityContextConstraints and refining PodSecurityPolicy usage to be scoped specifically to the speaker resource.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@oribon oribon changed the title OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage WIP: OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage Jun 23, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 23, 2026
@openshift-ci

openshift-ci Bot commented Jun 23, 2026

Copy link
Copy Markdown

@oribon: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@oribon oribon changed the title WIP: OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage OCPBUGS-91651: OpenShift only: reduce operator RBAC to match actual usage Jun 23, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 23, 2026
@oribon

oribon commented Jun 23, 2026

Copy link
Copy Markdown
Author

/verified by ci

@openshift-ci-robot

Copy link
Copy Markdown

@oribon: Jira verification commands are restricted to collaborators for this repo.

Details

In response to this:

/verified by ci

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@oribon

oribon commented Jun 24, 2026

Copy link
Copy Markdown
Author

/verified by ci

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@oribon: This PR has been marked as verified by ci.

Details

In response to this:

/verified by ci

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants