Skip to content

Commit 355ece1

Browse files
authored
[ws-manager] don't ever set PodRejected if WorkspaceConditionEverReady=true (#20372)
1 parent 99cc66b commit 355ece1

File tree

1 file changed

+8
-4
lines changed
  • components/ws-manager-mk2/controllers

1 file changed

+8
-4
lines changed

components/ws-manager-mk2/controllers/status.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ func (r *WorkspaceReconciler) updateWorkspaceStatus(ctx context.Context, workspa
143143
if failure != "" && !workspace.IsConditionTrue(workspacev1.WorkspaceConditionPodRejected) {
144144
// Check: A situation where we want to retry?
145145
if isPodRejected(pod) {
146-
// This is a situation where we want to re-create the pod!
147-
log.Info("workspace scheduling failed", "workspace", workspace.Name, "reason", failure)
148-
workspace.Status.SetCondition(workspacev1.NewWorkspaceConditionPodRejected(failure, metav1.ConditionTrue))
149-
r.Recorder.Event(workspace, corev1.EventTypeWarning, "PodRejected", failure)
146+
if !workspace.IsConditionTrue(workspacev1.WorkspaceConditionEverReady) {
147+
// This is a situation where we want to re-create the pod!
148+
log.Info("workspace got rejected", "workspace", workspace.Name, "reason", failure)
149+
workspace.Status.SetCondition(workspacev1.NewWorkspaceConditionPodRejected(failure, metav1.ConditionTrue))
150+
r.Recorder.Event(workspace, corev1.EventTypeWarning, "PodRejected", failure)
151+
} else {
152+
log.Info("workspace got rejected, but we don't handle it, because EveryReady=true", "workspace", workspace.Name, "reason", failure)
153+
}
150154
}
151155
}
152156

0 commit comments

Comments
 (0)