Fix VirtualMCPServer controller to check PodReady condition #2901
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
PodReadycondition instead ofPodRunningphaseProblem
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:
RunningRunning→ marks CR asReadyReady→ tries to connectSolution
Now the controller checks the
PodReadycondition inpod.Status.Conditions, which is the authoritative signal that a pod can receive traffic. This aligns with Kubernetes semantics.PodReadycondition =TruePodFailedphaseTest plan
go test ./cmd/thv-operator/controllers/... -run VirtualMCPServer)task lint)🤖 Generated with Claude Code