Skip to content

Commit ef13986

Browse files
iQQBotroboquat
authored andcommitted
Revert "[ws-manager] do not overwrite failed state"
This reverts commit 96c136f.
1 parent 66bc605 commit ef13986

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

components/ws-manager/pkg/manager/status.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,11 @@ func (m *Manager) extractStatusFromPod(result *api.WorkspaceStatus, wso workspac
350350
result.Phase = api.WorkspacePhase_STOPPING
351351

352352
_, podFailedBeforeBeingStopped := pod.Annotations[workspaceFailedBeforeStoppingAnnotation]
353-
if podFailedBeforeBeingStopped {
353+
if !podFailedBeforeBeingStopped {
354+
// While the pod is being deleted we do not care or want to know about any failure state.
355+
// If the pod got stopped because it failed we will have sent out a Stopping status with a "failure"
356+
result.Conditions.Failed = ""
357+
} else {
354358
if _, ok := pod.Annotations[workspaceNeverReadyAnnotation]; ok {
355359
// The workspace is never ready, so there is no need for a stopping phase.
356360
result.Phase = api.WorkspacePhase_STOPPED

components/ws-manager/pkg/manager/testdata/status_containerd4214_STOPPING00.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"phase": 6,
2222
"conditions": {
23-
"failed": "container workspace completed; containers of a workspace pod are not supposed to do that. Reason: ",
2423
"final_backup_complete": 1,
2524
"volume_snapshot": {}
2625
},

components/ws-manager/pkg/manager/testdata/status_disposal_STOPPED01.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"phase": 6,
2222
"conditions": {
23-
"failed": "ungraceful shutdown - teardown was unsuccessful: socket did not appear before context was canceled; last backup failed: testing the backup failure mode.",
23+
"failed": "last backup failed: testing the backup failure mode.",
2424
"final_backup_complete": 1,
2525
"volume_snapshot": {}
2626
},

components/ws-manager/pkg/manager/testdata/status_disposal_STOPPING02.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"phase": 6,
2222
"conditions": {
23-
"failed": "ungraceful shutdown - teardown was unsuccessful: socket did not appear before context was canceled",
2423
"final_backup_complete": 1,
2524
"volume_snapshot": {}
2625
},

0 commit comments

Comments
 (0)