Skip to content

🐛 add create verb to boxcutter preflight#2587

Open
kuiwang02 wants to merge 1 commit intooperator-framework:mainfrom
kuiwang02:fix78211
Open

🐛 add create verb to boxcutter preflight#2587
kuiwang02 wants to merge 1 commit intooperator-framework:mainfrom
kuiwang02:fix78211

Conversation

@kuiwang02
Copy link

Summary

Fixes Boxcutter applier's preflight permission check to properly validate namespace-scoped CREATE permissions.

Problem

After PR #2539, the Boxcutter applier's RBACPreAuthorizer was missing the WithNamespacedCollectionVerbs("create") configuration. This caused the preflight check to pass without validating CREATE permissions, leading to installation failures when the applier attempted to create resources like ServiceAccounts.

The Helm applier was correctly configured with this option (line 746), but the Boxcutter applier configuration (line 620) was missing it.

Changes

  • Added WithNamespacedCollectionVerbs("create") to Boxcutter's RBACPreAuthorizer instantiation in boxcutterReconcilerConfigurator.Configure()

Note: Boxcutter does not need WithClusterCollectionVerbs("list", "watch") because it doesn't use the contentmanager component, unlike the Helm applier.

Related Issues

Assisted-By: Claude Code

Copilot AI review requested due to automatic review settings March 24, 2026 05:30
@openshift-ci openshift-ci bot requested review from pedjak and trgeiger March 24, 2026 05:30
@netlify
Copy link

netlify bot commented Mar 24, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 01437c5
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69c33b99575f8d0008d3d12e
😎 Deploy Preview https://deploy-preview-2587--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Boxcutter applier preflight RBAC validation so it correctly checks for namespace-scoped CREATE permissions, preventing installs from passing preflight but failing later when creating namespaced resources (e.g., ServiceAccounts).

Changes:

  • Configure Boxcutter’s RBACPreAuthorizer with WithNamespacedCollectionVerbs("create") under the PreflightPermissions feature gate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kuiwang02 kuiwang02 changed the title 🐛add create verb to boxcutter preflight 🐛 add create verb to boxcutter preflight Mar 24, 2026
@kuiwang02 kuiwang02 changed the title 🐛 add create verb to boxcutter preflight Patch fix: 🐛 (:bug:) add create verb to boxcutter preflight Mar 24, 2026
@kuiwang02 kuiwang02 changed the title Patch fix: 🐛 (:bug:) add create verb to boxcutter preflight 🐛 add create verb to boxcutter preflight Mar 24, 2026
@kuiwang02
Copy link
Author

/cc @perdasilva

@openshift-ci openshift-ci bot requested a review from perdasilva March 24, 2026 05:37
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.79%. Comparing base (a307a6d) to head (01437c5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2587      +/-   ##
==========================================
+ Coverage   65.84%   67.79%   +1.95%     
==========================================
  Files         137      137              
  Lines        9560     9577      +17     
==========================================
+ Hits         6295     6493     +198     
+ Misses       2795     2585     -210     
- Partials      470      499      +29     
Flag Coverage Δ
e2e 38.09% <0.00%> (+26.90%) ⬆️
experimental-e2e 51.17% <100.00%> (+0.11%) ⬆️
unit 52.85% <0.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@fgiudici fgiudici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good catch!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 24, 2026
Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add e2e tests that assert the change.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 24, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 25, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fgiudici
Once this PR has been reviewed and has the lgtm label, please ask for approval from pedjak. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kuiwang02
Copy link
Author

LGTM. Good catch!

@fgiudici Thanks!

@kuiwang02
Copy link
Author

please add e2e tests that assert the change.

@pedjak I add e2e cases for the change and it passes. could you please review it again? Thanks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants