Skip to content

Commit 3918b50

Browse files
committed
add timeout ctx
1 parent fdaef82 commit 3918b50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

components/ws-daemon/pkg/controller/workspace_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ func (wsc *WorkspaceController) handleWorkspaceRunning(ctx context.Context, ws *
223223

224224
var imageInfo *workspacev1.WorkspaceImageInfo = nil
225225
if ws.Status.ImageInfo == nil {
226+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
227+
defer cancel()
226228
id, err := wsc.runtime.WaitForContainer(ctx, ws.Name)
227229
if err != nil {
228230
return ctrl.Result{}, fmt.Errorf("failed to wait for container: %w", err)

0 commit comments

Comments
 (0)