Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mark prebuilds with failing tasks unavailable #4975

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions components/ws-manager-bridge/ee/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ export class WorkspaceManagerBridgeEE extends WorkspaceManagerBridge {
prebuild.error = status.conditions!.timeout;
headlessUpdateType = HeadlessWorkspaceEventType.AbortedTimedOut;
} else if (!!status.conditions!.failed) {
prebuild.state = "aborted"
prebuild.state = "aborted";
prebuild.error = status.conditions!.failed;
headlessUpdateType = HeadlessWorkspaceEventType.Aborted;
} else if (!!status.conditions!.headlessTaskFailed) {
prebuild.state = "aborted"
prebuild.state = "available";
prebuild.error = status.conditions!.headlessTaskFailed;
prebuild.snapshot = status.conditions!.snapshot;
headlessUpdateType = HeadlessWorkspaceEventType.FinishedButFailed;
} else {
prebuild.state = "available";
Expand Down
2 changes: 1 addition & 1 deletion components/ws-manager/pkg/manager/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ func extractFailure(wso workspaceObjects) (string, *api.WorkspacePhase) {
// can go in this state and that's ok. However, if the workspace was shutting down due to deletion,
// we would not be here as we've checked for a DeletionTimestamp prior. So let's find out why the
// container is terminating.
if terminationState.Message != "" {
if terminationState.ExitCode != 0 && terminationState.Message != "" {
// the container itself told us why it was terminated - use that as failure reason
return extractFailureFromLogs([]byte(terminationState.Message)), nil
} else if terminationState.Reason == "Error" {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"status": {
"id": "60116ccc-1593-41f5-880e-6c4010dc4d1d",
"metadata": {
"owner": "71548797-a589-45fa-bf22-6aec554dded0",
"meta_id": "sapphire-alligator-jakcgz44",
"started_at": {
"seconds": 1627410546
}
},
"spec": {
"workspace_image": "eu.gcr.io/gitpod-core-dev/registry/workspace-images:295486e99855b59cf8d32b8d9b6c3c0abcf4b76acb8e511f7c919b0341c60f35",
"ide_image": "eu.gcr.io/gitpod-core-dev/build/ide/code:commit-c77d5c144ba894ff5ae71a25af7fe3af4d4bd398",
"headless": true,
"url": "https://sapphire-alligator-jakcgz44.ws-dev.csweichel-don-t-abort-prebuild-4964.staging.gitpod-dev.com",
"type": 1
},
"phase": 5,
"conditions": {
"service_exists": 1,
"deployed": 1,
"headless_task_failed": "headless task failed"
},
"message": "headless workspace is stopping",
"runtime": {
"node_name": "gke-dev-workload-4-5712746c-38bw",
"pod_name": "prebuild-60116ccc-1593-41f5-880e-6c4010dc4d1d",
"node_ip": "10.132.15.209"
},
"auth": {
"owner_token": "E8-X0p-tciJQOuPB4DLCyvAXN-6_PM3n"
}
}
}