THREESCALE-14653 Fix route watch cannot map events to APIManager when Zync is disabled#1176
Open
urbanikb wants to merge 1 commit into3scale:masterfrom
Open
THREESCALE-14653 Fix route watch cannot map events to APIManager when Zync is disabled#1176urbanikb wants to merge 1 commit into3scale:masterfrom
urbanikb wants to merge 1 commit into3scale:masterfrom
Conversation
|
Skipping CI for Draft Pull Request. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1176 +/- ##
==========================================
+ Coverage 41.84% 43.95% +2.10%
==========================================
Files 203 204 +1
Lines 20859 20911 +52
==========================================
+ Hits 8729 9191 +462
+ Misses 11350 10919 -431
- Partials 780 801 +21
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Replace the ownerRef-chain mapper (Route → Zync → APIManager) with a domain-name mapper that lists APIManagers in the namespace and matches by expected tenant route hosts. The ownerRef chain is broken when Zync is disabled, causing noisy not-found errors and stale availability status. The new mapper is indifferent to who created the route — Zync-managed routes and manually-created routes are handled identically, avoiding the need for callers to fake a Zync label just to get status updates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes THREESCALE-14653
Root cause
The operator monitored routes by traversing the owner-reference chain from Route → Zync resource → APIManager. This chain breaks when Zync is disabled or when Zync is being deleted — theoretically Zync's deployment should carry a finalizer that holds deletion until its owned routes are cleaned up first, but that guarantee is not in place. The result is that route events cannot be mapped back to any APIManager, producing noisy not-found errors in the logs and leaving the availability status stale until the next unrelated reconcile event.
Solution
Replace the owner-reference chain mapper with a domain-name mapper that lists APIManagers in the namespace and matches by expected tenant route hosts. This approach is significantly more straightforward than adding a finalizer to the Zync deployment and is indifferent to who created the route — Zync-managed routes, manually-created routes, and routes created without the Zync label are all handled identically.
The label predicate (
3scale.net/created-by=zync) that was initially considered as a watch filter was dropped because:Changes
APIManagerRoutesEventMapper(ownerRef chain) withZyncRouteToAPIManagerMapper(domain-name matching)pkg/handlers/apimanager_managed_routes_event_mapper.goAvailable=False, recreate it manually without the Zync label, verifyAvailable=TrueTest plan
go test ./controllers/apps/... -run TestZyncRoutemake test-integration(verified locally)🤖 Generated with Claude Code