Skip to content

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

Open
julius-malcovsky wants to merge 2 commits intofeature/dtcfrom
feature/api-refactor
Open

feat(exposure-driven): proxy route creation is now driven by api expo…#300
julius-malcovsky wants to merge 2 commits 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 <[email protected]>
Co-authored-by: Ismael Garba <[email protected]>
Co-authored-by: Stefan Siber <[email protected]>
Co-authored-by: Ron Gummich <[email protected]>
@julius-malcovsky julius-malcovsky marked this pull request as ready for review March 30, 2026 20:41
@julius-malcovsky julius-malcovsky requested review from Copilot, ron96g and stefan-ctrl and removed request for Copilot and ron96g March 30, 2026 20:41
@julius-malcovsky julius-malcovsky self-assigned this Mar 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Björn Kottner <[email protected]>
Co-authored-by: Ismael Garba <[email protected]>
Co-authored-by: Stefan Siber <[email protected]>
Co-authored-by: Ron Gummich <[email protected]>
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.

2 participants