Commit 55d0cee
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>1 parent 32b63c5 commit 55d0cee
File tree
2 files changed
+69
-19
lines changed- cmd/thv-operator/controllers
2 files changed
+69
-19
lines changedLines changed: 33 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | | - | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1023 | 1026 | | |
1024 | 1027 | | |
1025 | 1028 | | |
1026 | | - | |
| 1029 | + | |
1027 | 1030 | | |
1028 | | - | |
1029 | | - | |
| 1031 | + | |
| 1032 | + | |
1030 | 1033 | | |
1031 | 1034 | | |
1032 | 1035 | | |
| |||
1050 | 1053 | | |
1051 | 1054 | | |
1052 | 1055 | | |
1053 | | - | |
| 1056 | + | |
1054 | 1057 | | |
1055 | | - | |
| 1058 | + | |
1056 | 1059 | | |
1057 | 1060 | | |
1058 | 1061 | | |
| |||
1081 | 1084 | | |
1082 | 1085 | | |
1083 | 1086 | | |
1084 | | - | |
1085 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1086 | 1091 | | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
| 1092 | + | |
| 1093 | + | |
1093 | 1094 | | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1097 | 1112 | | |
1098 | 1113 | | |
1099 | 1114 | | |
1100 | 1115 | | |
1101 | 1116 | | |
1102 | | - | |
| 1117 | + | |
1103 | 1118 | | |
1104 | 1119 | | |
1105 | 1120 | | |
| |||
Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
579 | | - | |
| 579 | + | |
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
595 | 601 | | |
596 | 602 | | |
597 | 603 | | |
598 | 604 | | |
599 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
600 | 635 | | |
601 | 636 | | |
602 | 637 | | |
| |||
0 commit comments