Skip to content

feat(exposure-driven): proxy route creation is now driven by api expo…#300

Draft
julius-malcovsky wants to merge 1 commit intofeature/dtcfrom
feature/api-refactor
Draft

feat(exposure-driven): proxy route creation is now driven by api expo…#300
julius-malcovsky wants to merge 1 commit intofeature/dtcfrom
feature/api-refactor

Conversation

@julius-malcovsky
Copy link
Copy Markdown
Contributor

@julius-malcovsky julius-malcovsky commented Mar 28, 2026

Refactor: Exposure-Driven Proxy Route Creation

Changes

Moved proxy route creation responsibility from ApiSubscription to ApiExposure. The exposure now creates all proxy routes (for subscriber zones and failover zones) and manages their lifecycle via a janitor
pattern.

Benefits

  • Deduplication: Multiple subscriptions in the same zone now share a single proxy route
  • Simplified logic: Single source of truth for proxy route creation
  • Better lifecycle management: Routes are cleaned up when no longer needed

Testing

Added 6 comprehensive test scenarios covering edge cases:

  1. Approval denial/revocation cleanup
  2. Subscriber failover to provider failover zone (no duplicates)
  3. Same-zone subscription with cross-zone failover
  4. Multiple subscriptions sharing zone with different failover configs
  5. All subscriptions in same zone (no unnecessary proxies)
  6. Provider failover zone reuse by subscribers

Split test file for better organization:

  • apisubscription_controller_test.go - main subscription tests
  • apisubscription_controller_failover_test.go - failover scenarios

…sure, instead of subscription

Co-authored-by: Björn Kottner <BjoernKarma@users.noreply.github.com>
Co-authored-by: Ismael Garba <iagarba@users.noreply.github.com>
Co-authored-by: Stefan Siber <stefan-ctrl@users.noreply.github.com>
Co-authored-by: Ron Gummich <ron96g@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant