@@ -1128,7 +1128,10 @@ func countBackendHealth(ctx context.Context, backends []mcpv1alpha1.DiscoveredBa
11281128 return ready , unhealthy
11291129}
11301130
1131- // determineStatusFromBackends evaluates backend health to determine status
1131+ // determineStatusFromBackends evaluates backend health to determine status.
1132+ // This function should ONLY be called when health monitoring is enabled
1133+ // (spec.operational.failureHandling.healthCheckInterval is set).
1134+ // When health monitoring is disabled, backend health status is meaningless.
11321135func (* VirtualMCPServerReconciler ) determineStatusFromBackends (
11331136 ctx context.Context ,
11341137 vmcp * mcpv1alpha1.VirtualMCPServer ,
@@ -1222,9 +1225,14 @@ func (r *VirtualMCPServerReconciler) determineStatusFromPods(
12221225 // Get current discovered backends from status manager (may be updated but not applied yet)
12231226 discoveredBackends := statusManager .GetDiscoveredBackends ()
12241227
1225- // Pods are ready (passed readiness probes) - check backend health if backends exist
1226- if len (discoveredBackends ) == 0 {
1227- // No backends discovered yet - pods ready is sufficient for Ready
1228+ // Check if health monitoring is enabled
1229+ healthMonitoringEnabled := vmcp .Spec .Operational != nil &&
1230+ vmcp .Spec .Operational .FailureHandling != nil &&
1231+ vmcp .Spec .Operational .FailureHandling .HealthCheckInterval != ""
1232+
1233+ // Pods are ready (passed readiness probes) - check backend health if backends exist AND health monitoring is enabled
1234+ if len (discoveredBackends ) == 0 || ! healthMonitoringEnabled {
1235+ // No backends discovered yet OR health monitoring disabled - pods ready is sufficient for Ready
12281236 return statusDecision {
12291237 phase : mcpv1alpha1 .VirtualMCPServerPhaseReady ,
12301238 message : "Virtual MCP server is running" ,
@@ -1234,7 +1242,7 @@ func (r *VirtualMCPServerReconciler) determineStatusFromPods(
12341242 }
12351243 }
12361244
1237- // Backends exist - determine health status using current backends from status manager
1245+ // Backends exist AND health monitoring enabled - determine health status using current backends from status manager
12381246 return r .determineStatusFromBackends (ctx , vmcp , discoveredBackends )
12391247}
12401248
0 commit comments