Skip to content

Commit

Permalink
[ws-manager] do not overwrite failed state
Browse files Browse the repository at this point in the history
  • Loading branch information
sagor999 committed Jul 15, 2022
1 parent 0945a99 commit f55f6e6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions components/ws-manager/pkg/manager/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,7 @@ func (m *Manager) extractStatusFromPod(result *api.WorkspaceStatus, wso workspac
result.Phase = api.WorkspacePhase_STOPPING

_, podFailedBeforeBeingStopped := pod.Annotations[workspaceFailedBeforeStoppingAnnotation]
if !podFailedBeforeBeingStopped {
// While the pod is being deleted we do not care or want to know about any failure state.
// If the pod got stopped because it failed we will have sent out a Stopping status with a "failure"
result.Conditions.Failed = ""
} else {
if podFailedBeforeBeingStopped {
if _, ok := pod.Annotations[workspaceNeverReadyAnnotation]; ok {
// The workspace is never ready, so there is no need for a stopping phase.
result.Phase = api.WorkspacePhase_STOPPED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"phase": 6,
"conditions": {
"failed": "container workspace completed; containers of a workspace pod are not supposed to do that. Reason: ",
"final_backup_complete": 1,
"volume_snapshot": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"phase": 6,
"conditions": {
"failed": "last backup failed: testing the backup failure mode.",
"failed": "ungraceful shutdown - teardown was unsuccessful: socket did not appear before context was canceled; last backup failed: testing the backup failure mode.",
"final_backup_complete": 1,
"volume_snapshot": {}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"phase": 6,
"conditions": {
"failed": "ungraceful shutdown - teardown was unsuccessful: socket did not appear before context was canceled",
"final_backup_complete": 1,
"volume_snapshot": {}
},
Expand Down

0 comments on commit f55f6e6

Please sign in to comment.