Remove backend discovery from operator in dynamic mode#3248
Remove backend discovery from operator in dynamic mode#3248
Conversation
In dynamic mode (outgoingAuth.source: discovered), the vMCP server owns backend discovery and reports status. The operator should only observe this status rather than discovering backends itself. This change implements the responsibility shift described in the THV-2884 proposal. In static mode (outgoingAuth.source: inline), the operator continues to discover backends from MCPGroup as before. Resolves #3004
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3248 +/- ##
==========================================
+ Coverage 56.97% 57.03% +0.06%
==========================================
Files 351 351
Lines 34962 34974 +12
==========================================
+ Hits 19919 19948 +29
+ Misses 13387 13365 -22
- Partials 1656 1661 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR implements the removal of backend discovery from the operator in dynamic mode, as described in the THV-2884 proposal. In dynamic mode (outgoingAuth.source: discovered), the vMCP server owns backend discovery and reports status directly, while the operator only observes this status. In static mode (outgoingAuth.source: inline), the operator continues to discover backends from MCPGroup as before.
Changes:
- Added mode detection logic to differentiate between dynamic and static modes
- Refactored backend discovery to be mode-aware - skipped in dynamic mode, performed in static mode
- Added comprehensive tests covering both modes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/proposals/THV-2884-vmcp-k8s-aware-refactor.md | Updated proposal to reflect implementation status with checkmarks |
| cmd/thv-operator/controllers/virtualmcpserver_mode_test.go | Added comprehensive tests for mode detection and both dynamic/static mode behaviors |
| cmd/thv-operator/controllers/virtualmcpserver_controller.go | Added isDynamicMode helper and handleBackendDiscovery function to conditionally discover backends based on mode |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
In dynamic mode (outgoingAuth.source: discovered), the vMCP server owns backend discovery and reports status. The operator should only observe this status rather than discovering backends itself.
This change implements the responsibility shift described in the THV-2884 proposal. In static mode (outgoingAuth.source: inline), the operator continues to discover backends from MCPGroup as before.
Resolves #3004