fix(controller): ESO-481 fix secondary watch predicates - #182
fix(controller): ESO-481 fix secondary watch predicates#182siddhibhor-56 wants to merge 1 commit into
Conversation
…ld and new objects on update The managedOrWatchedResources predicate was built with predicate.NewPredicateFuncs which only inspects ObjectNew on update events. When a watched label (e.g. trustedCABundle ConfigMap) was removed externally, the event was filtered out and reconciliation never ran — breaking self-healing for watched ConfigMaps. Extract a shared labelMatchPredicate helper that builds predicate.Funcs checking both ObjectOld and ObjectNew on updates. Consolidate the inline isManagedResource closure and the NewPredicateFuncs block into two package-level matchers (isManagedResource, isManagedOrWatchedResource) both using the new helper. Add unit tests covering update, create, delete, and generic event behavior for both managed and watched resource predicates.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
PR needs rebase. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: siddhibhor-56 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 |
|
@siddhibhor-56: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe change extracts reusable label predicates for managed and watched resources, updates controller wiring to use them, and adds tests for label transitions and resource event types. ChangesConfigMap predicate reconciliation fix
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized predicate update and its accompanying tests leave no actionable merge-blocking risk; the PR is merge-ready after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches 💡 2⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
/retitle ai-eval: DNM, fix(controller): ESO-481 fix secondary watch predicates |
The managedOrWatchedResources predicate was built with predicate.NewPredicateFuncs which only inspects ObjectNew on update events. When a watched label (e.g. trustedCABundle ConfigMap) was removed externally, the event was filtered out and reconciliation never ran — breaking self-healing for watched ConfigMaps.
Extract a shared labelMatchPredicate helper that builds predicate.Funcs checking both ObjectOld and ObjectNew on updates. Consolidate the inline isManagedResource closure and the NewPredicateFuncs block into two package-level matchers (isManagedResource, isManagedOrWatchedResource) both using the new helper.
Add unit tests covering update, create, delete, and generic event behavior for both managed and watched resource predicates.
Description
What changed?
Why?
How?
Type of Change
Checklist
make verifypasses (vet, fmt, deps, bindata, generated files, govulncheck, git diff)make testpasses (unit + API integration tests)make lintpasses.testsuite.yamltests for new CEL rulescontrollerManagedResources,buildCacheObjectList(),HasObjectChanged, and the ordered install sequencebindata.go,zz_generated.deepcopy.go, CRD YAML, fakes)IrrecoverableError/RetryRequiredError/UserConfigurationError)Testing
Additional Context
Summary by CodeRabbit
Bug Fixes
Tests
Documentation