Repository navigation
Add CSV field to disable role aggregation - #537
joelanford wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #537 +/- ##
==========================================
- Coverage 22.33% 22.30% -0.03%
==========================================
Files 60 60
Lines 7872 7880 +8
==========================================
Hits 1758 1758
- Misses 5962 5970 +8
Partials 152 152 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add an optional spec.disableRoleAggregation boolean to ClusterServiceVersion so operator bundles can express whether OLM should disable aggregation of roles for their provided APIs. Omitting the field or setting it to false preserves the existing default behavior. Document the intended behavior when the field is enabled: OLM continues creating and maintaining ClusterRoles for provided APIs, but omits their role aggregation labels. Also document the upgrade implications for users whose access currently depends on aggregation into the standard admin, edit, and view roles. Update the generated ClusterServiceVersion CRD, embedded CRD data, and OpenAPI definitions to expose the new field consistently. This change provides the API surface only; runtime enforcement belongs in OLM. Co-Authored-By: GPT-6.1 Sol
8a12de1 to
250eb70
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold We need to decide if we want to use a spec-based approach (which has better schema validation and discoverability UX, but isn't as forward-compatible) OR if we use an annotation-based approach (which has better update UX, but loses the schema validation and discoverability) Many OLM catalogs are curated for specific minor versions of kubernetes, not for specific versions of OLM. This mismatch means that an old OLM version might update an operator that includes this new field in its CSV. However that old OLM version does not have the new field in its CRD schema, which means the new field will be dropped from the CSV during the operator update. If/when the OLM version eventually is updated to the version that includes the new CRD schema, it is too late. The field has already been dropped, and OLM does not re-apply the CSV except during operator installations or updates. Therefore the spec-based approach will require an update of OLM followed by one of:
We believe (though haven't yet verified as of 11/17/2026) that an annotation-based approach would enable the operator update to occur prior to the OLM update (the annotation would be persisted in etcd, but old OLM would not know about it). After the OLM update, we think the annotation would be discovered and the aggregation labels would be removed without requiring a subsequent update or uninstall/reinstall. |
| // field may cause users who rely on aggregated permissions to lose access | ||
| // to those APIs unless equivalent permissions are granted through separate | ||
| // RoleBindings or ClusterRoleBindings. | ||
| // +optional |
There was a problem hiding this comment.
Oh, we also need to make this field immutable so that users are not able to modify it away from operator author intent.
Summary
Add an optional
spec.disableRoleAggregationfield toClusterServiceVersion, allowing operator bundles to express an opt-out
from OLM standard role aggregation for provided APIs.
By default, OLM aggregates permissions for provided APIs into the
standard
admin,edit, andviewroles. This field provides an explicitway to request that those permissions not be automatically aggregated,
while retaining the ClusterRoles that OLM creates and maintains.
Changes
DisableRoleAggregationtoClusterServiceVersionSpecas anoptional boolean with the JSON name
disableRoleAggregation.set to
false.true: continuemaintaining the ClusterRoles for provided APIs, but omit their role
aggregation labels.
permissions. Those users may require separate role bindings to retain
access to the provided APIs.
OpenAPI definitions.
This PR adds the API field and schema support only. Runtime enforcement
of the setting belongs in OLM.
Test plan
make test-uniton the change rebased onto current upstreammaster.make verifyfrom a clean jj working copy after rebasing andresolving the embedded CRD conflict. Generation, formatting, module
verification, and the final clean-diff check all pass.
Generated with the assistance of generative AI
Summary by CodeRabbit