Skip to content

Commit f0e642e

Browse files
committed
Explicitly add failed status
Signed-off-by: Juan Antonio Osorio <[email protected]>
1 parent c28cd63 commit f0e642e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/thv-operator/controllers/mcpserver_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ func (r *MCPServerReconciler) validateAndUpdatePodTemplateStatus(ctx context.Con
442442
r.Recorder.Eventf(mcpServer, corev1.EventTypeWarning, "InvalidPodTemplateSpec",
443443
"Failed to parse PodTemplateSpec: %v. Deployment blocked until PodTemplateSpec is fixed.", err)
444444

445+
// Set phase and message
446+
mcpServer.Status.Phase = mcpv1alpha1.MCPServerPhaseFailed
447+
mcpServer.Status.Message = fmt.Sprintf("Invalid PodTemplateSpec: %v", err)
448+
445449
// Set condition for invalid PodTemplateSpec
446450
meta.SetStatusCondition(&mcpServer.Status.Conditions, metav1.Condition{
447451
Type: "PodTemplateValid",
@@ -454,6 +458,7 @@ func (r *MCPServerReconciler) validateAndUpdatePodTemplateStatus(ctx context.Con
454458
// Update status with the condition
455459
if statusErr := r.Status().Update(ctx, mcpServer); statusErr != nil {
456460
ctxLogger.Error(statusErr, "Failed to update MCPServer status with PodTemplateSpec validation")
461+
return false
457462
}
458463

459464
ctxLogger.Error(err, "PodTemplateSpec validation failed")

0 commit comments

Comments
 (0)