• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 19942776892

04 Dec 2025 08:22PM UTC coverage: 49.811% (+0.02%) from 49.796%
19942776892

push

github

web-flow
Fix VirtualMCPServer controller to check PodReady condition (#2901)

The VirtualMCPServer controller was marking the CR as Ready based on
pod.Status.Phase == PodRunning, but this doesn't guarantee the pod is
actually ready to serve traffic. A pod can be in Running phase while
still waiting for its readiness probe to pass.

This caused flaky E2E tests where:
1. Pod starts → Phase becomes Running
2. Controller sees Running → marks CR as Ready
3. Test sees CR Ready → tries to connect
4. Pod hasn't passed readiness probe → EOF error

Now the controller checks the PodReady condition in pod.Status.Conditions,
which is the authoritative signal that a pod can receive traffic. This
aligns with Kubernetes semantics and ensures the VirtualMCPServer is only
marked Ready when the underlying HTTP server is actually responding.

Changes:
- Check PodReady condition instead of PodRunning phase
- Rename 'running' counter to 'ready' for clarity
- Add test case for "running but not ready" pods
- Update existing test to set PodReady condition

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>

26226 of 52651 relevant lines covered (49.81%)

59.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.59
/cmd/thv-operator/controllers/virtualmcpserver_controller.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc