Skip to content

Conversation

@yrobla
Copy link
Contributor

@yrobla yrobla commented Dec 1, 2025

Properly reconcile mcpserver status, and subsequentially, the vmcp status. Add tests to validate that status is propagated

Properly reconcile mcpserver status, and subsequentially, the
vmcp status. Add tests to validate that status is propagated
@yrobla yrobla requested a review from Copilot December 1, 2025 14:50
@github-actions github-actions bot added the size/S Small PR: 100-299 lines changed label Dec 1, 2025
@yrobla yrobla requested review from JAORMX, amirejaz and Copilot and removed request for JAORMX and Copilot December 1, 2025 14:50
Copilot finished reviewing on behalf of yrobla December 1, 2025 14:53
Copy link
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.

Pull request overview

This PR fixes MCP controller status propagation to ensure that backend health changes are properly reflected in VirtualMCPServer status. The key improvements include detecting container errors (ImagePullBackOff, CrashLoopBackOff) in MCPServer pods to transition them to Failed state, propagating MCPServer phase to VirtualMCPServer backend status, and updating VirtualMCPServer phase to Degraded when backends are unavailable.

  • Adds container error detection in MCPServer status reconciliation to properly mark pods as Failed
  • Implements backend health-based phase determination for VirtualMCPServer (Ready/Degraded states)
  • Updates BackendCount to only count ready backends while DiscoveredBackends tracks all backends
  • Adds comprehensive E2E test validating status transitions when backends become unhealthy and recover

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
test/e2e/thv-operator/virtualmcp/virtualmcp_yardstick_base_test.go Adds E2E test validating VirtualMCPServer status transitions from Ready to Degraded when backends fail, and back to Ready when recovered
cmd/thv-operator/pkg/virtualmcpserverstatus/collector.go Updates BackendCount calculation to only count ready backends instead of all discovered backends
cmd/thv-operator/controllers/virtualmcpserver_controller.go Adds backend status constants and logic to set VirtualMCPServer phase to Degraded when backends are unavailable; ensures MCPServer phase propagates to backend status
cmd/thv-operator/controllers/mcpserver_controller.go Adds helper functions to detect container errors (ImagePullBackOff, CrashLoopBackOff) and categorize pods as Failed instead of Pending when containers are in error states

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

@github-actions github-actions bot added size/M Medium PR: 300-599 lines changed and removed size/S Small PR: 100-299 lines changed labels Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants