Skip to content

Commit fbf2e6f

Browse files
sagor999mustard-mh
authored andcommitted
[ws-manager] fix not handling workspaces that are completed
1 parent f7f32d3 commit fbf2e6f

File tree

4 files changed

+500
-0
lines changed

4 files changed

+500
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@ func (m *Manager) extractStatusFromPod(result *api.WorkspaceStatus, wso workspac
495495
result.Phase = api.WorkspacePhase_STOPPING
496496
result.Message = "headless workspace is stopping"
497497
return nil
498+
} else if status.Phase == corev1.PodSucceeded {
499+
result.Phase = api.WorkspacePhase_STOPPING
500+
result.Message = "workspace is stopping"
501+
return nil
498502
} else if status.Phase == corev1.PodUnknown {
499503
result.Phase = api.WorkspacePhase_UNKNOWN
500504
result.Message = "Kubernetes reports workspace phase as unknown"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"actions": [
3+
{
4+
"Func": "clearInitializerFromMap",
5+
"Params": {
6+
"podName": "ws-75ca49e0-c4e6-4eb0-896f-aec069880f93"
7+
}
8+
},
9+
{
10+
"Func": "deleteWorkspaceSecrets",
11+
"Params": {
12+
"podName": "ws-75ca49e0-c4e6-4eb0-896f-aec069880f93"
13+
}
14+
},
15+
{
16+
"Func": "stopWorkspace",
17+
"Params": {
18+
"gracePeriod": 30000000000,
19+
"workspaceID": "75ca49e0-c4e6-4eb0-896f-aec069880f93"
20+
}
21+
}
22+
]
23+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"status": {
3+
"id": "75ca49e0-c4e6-4eb0-896f-aec069880f93",
4+
"status_version": 65536,
5+
"metadata": {
6+
"owner": "32a9048a-6037-4571-a96f-f640fc949bd0",
7+
"meta_id": "giaa0502-ddos-kd27l9j4i3c",
8+
"started_at": {
9+
"seconds": 1659327428
10+
}
11+
},
12+
"spec": {
13+
"workspace_image": "eu.gcr.io/gitpod-dev/workspace-images:14fe8d8eced804f7ab64fff765bd9b98d7c27fc485e52cf50d11b73a1daf49e9",
14+
"deprecated_ide_image": "eu.gcr.io/gitpod-core-dev/build/ide/code:commit-079f161f0aaf95d6b5e28f0709b3e629337291e9",
15+
"url": "https://giaa0502-ddos-kd27l9j4i3c.ws-us58.gitpod.io",
16+
"exposed_ports": [
17+
{
18+
"port": 3000,
19+
"url": "https://3000-giaa0502-ddos-kd27l9j4i3c.ws-us58.gitpod.io"
20+
}
21+
],
22+
"timeout": "30m",
23+
"ide_image": {
24+
"web_ref": "eu.gcr.io/gitpod-core-dev/build/ide/code:commit-079f161f0aaf95d6b5e28f0709b3e629337291e9",
25+
"supervisor_ref": "eu.gcr.io/gitpod-core-dev/build/supervisor:commit-2e2a3d535732efd8c38868810b73e5fde3239002"
26+
},
27+
"class": "default"
28+
},
29+
"phase": 5,
30+
"conditions": {
31+
"volume_snapshot": {}
32+
},
33+
"message": "workspace is stopping",
34+
"runtime": {
35+
"node_name": "workspace-ws-us58-pool-qx7j",
36+
"pod_name": "ws-75ca49e0-c4e6-4eb0-896f-aec069880f93",
37+
"node_ip": "10.10.0.9"
38+
},
39+
"auth": {}
40+
}
41+
}

0 commit comments

Comments
 (0)