Skip to content

Commit

Permalink
[ws-manager] don't ever set PodRejected if WorkspaceConditionEverRead…
Browse files Browse the repository at this point in the history
…y=true (#20372)
  • Loading branch information
geropl authored Nov 15, 2024
1 parent 99cc66b commit 355ece1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions components/ws-manager-mk2/controllers/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,14 @@ func (r *WorkspaceReconciler) updateWorkspaceStatus(ctx context.Context, workspa
if failure != "" && !workspace.IsConditionTrue(workspacev1.WorkspaceConditionPodRejected) {
// Check: A situation where we want to retry?
if isPodRejected(pod) {
// This is a situation where we want to re-create the pod!
log.Info("workspace scheduling failed", "workspace", workspace.Name, "reason", failure)
workspace.Status.SetCondition(workspacev1.NewWorkspaceConditionPodRejected(failure, metav1.ConditionTrue))
r.Recorder.Event(workspace, corev1.EventTypeWarning, "PodRejected", failure)
if !workspace.IsConditionTrue(workspacev1.WorkspaceConditionEverReady) {
// This is a situation where we want to re-create the pod!
log.Info("workspace got rejected", "workspace", workspace.Name, "reason", failure)
workspace.Status.SetCondition(workspacev1.NewWorkspaceConditionPodRejected(failure, metav1.ConditionTrue))
r.Recorder.Event(workspace, corev1.EventTypeWarning, "PodRejected", failure)
} else {
log.Info("workspace got rejected, but we don't handle it, because EveryReady=true", "workspace", workspace.Name, "reason", failure)
}
}
}

Expand Down

0 comments on commit 355ece1

Please sign in to comment.