Skip to content

Commit 96c136f

Browse files
sagor999roboquat
authored andcommitted
[ws-manager] do not overwrite failed state
1 parent a24ad15 commit 96c136f

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

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

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

352352
_, podFailedBeforeBeingStopped := pod.Annotations[workspaceFailedBeforeStoppingAnnotation]
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 {
353+
if podFailedBeforeBeingStopped {
358354
if _, ok := pod.Annotations[workspaceNeverReadyAnnotation]; ok {
359355
// The workspace is never ready, so there is no need for a stopping phase.
360356
result.Phase = api.WorkspacePhase_STOPPED

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

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

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": "last backup failed: testing the backup failure mode.",
23+
"failed": "ungraceful shutdown - teardown was unsuccessful: socket did not appear before context was canceled; 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"phase": 6,
2222
"conditions": {
23+
"failed": "ungraceful shutdown - teardown was unsuccessful: socket did not appear before context was canceled",
2324
"final_backup_complete": 1,
2425
"volume_snapshot": {}
2526
},

0 commit comments

Comments
 (0)