Move AggregationRuleTransform to shared common package to fix eventing RBAC race#2316
Move AggregationRuleTransform to shared common package to fix eventing RBAC race#2316creydr wants to merge 1 commit into
Conversation
AggregationRuleTransform was only applied to KnativeServing but not to KnativeEventing. This caused the operator to continuously overwrite the rules of aggregated ClusterRoles (e.g. channelable-manipulator) with empty rules from the manifest, creating a race condition with the Kubernetes aggregation controller. During the race window, RBAC lookups against the aggregated role return 403 Forbidden. Move the transform from knativeserving/common to the shared reconciler/common package and apply it inside Transform(), so every component (Serving, Eventing, Kafka) benefits automatically. Signed-off-by: Christoph Stäbler <cstabler@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: creydr The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2316 +/- ##
==========================================
+ Coverage 63.84% 63.89% +0.05%
==========================================
Files 55 55
Lines 2478 2479 +1
==========================================
+ Hits 1582 1584 +2
+ Misses 777 776 -1
Partials 119 119 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/cc @maschmid |
|
/cherry-pick release-1.22 |
|
@creydr: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
|
/cherry-pick release-1.21 |
|
@creydr: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
channelable-manipulatoris a Kubernetes aggregated ClusterRole — itsaggregationRuletells theaggregation controller to populate the
rulesfield automatically from matching ClusterRoles.The operator's manifestival reconciliation applies this ClusterRole from its manifest every ~16 seconds.
Because the manifest declares only the
aggregationRulewithrules: [], each apply temporarilyclears the aggregated rules. The Kubernetes aggregation controller re-fills them within ~50–200ms,
but during that window any RBAC check against the role returns 403 Forbidden.
This affects the eventing controller when it patches InMemoryChannels — roughly 0.6% of patch
attempts hit the race window, causing
Subscriptionfinalizer failures.The root cause is that
AggregationRuleTransform(which preserves the cluster's current rulesbefore applying) was only wired into KnativeServing but not KnativeEventing.
This PR addresses it by:
AggregationRuleTransformfromknativeserving/common/to the sharedreconciler/common/packageTransform()function, so all components (Serving, Eventing, Kafka) get it automaticallychannelable-manipulator) to the existing testRelease Note