Repository navigation
Conversation
The EventPolicy controller registers every EventPolicy as an observer of the objects referenced in `spec.from` through `resolver.NewAuthenticatableResolverFromTracker(ctx, impl.Tracker)`. The informer handler only enqueued on delete, so a deleted EventPolicy stayed in the tracker until its lease expired and kept being re-enqueued. Call Tracker.OnDeletedObserver on delete, as done for Subscriptions in knative#9421. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lbarrosby 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 |
|
Hi @lbarrosby. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9517 +/- ##
==========================================
+ Coverage 51.31% 51.34% +0.02%
==========================================
Files 411 411
Lines 22187 22191 +4
==========================================
+ Hits 11386 11393 +7
+ Misses 9920 9916 -4
- Partials 881 882 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same issue and fix as #9421 (Subscription) and #9511 (ApiServerSource), here for the EventPolicy controller.
The EventPolicy controller registers every EventPolicy as an observer of the objects referenced in
spec.fromthroughresolver.NewAuthenticatableResolverFromTracker(ctx, impl.Tracker). Its informer handler iscontroller.HandleAll(impl.Enqueue), so nothing callsTracker.OnDeletedObserverwhen a EventPolicy is deleted. The deleted EventPolicy stays in the tracker until the lease expires, and every change to a tracked object in the meantime re-enqueues a key that no longer exists.Proposed Changes
Pre-review Checklist
Testing
TestEventPolicyDeleteRemovesTrackerObservers(same shape as the tests in #9421 and #9511) tracks a reference for a EventPolicy, creates and deletes the EventPolicy through the fake client and waits for the tracker to drop it. The ConfigMap watcher used byTestNewmoved to a small helper so both tests share it.On main:
With the fix:
Release Note
Docs
AI disclosure: written with the help of Claude Code, reviewed and tested by me.