diff --git a/components/local-app/cmd/workspace-stop.go b/components/local-app/cmd/workspace-stop.go index a764a6189e3fe3..27239dee691c9c 100644 --- a/components/local-app/cmd/workspace-stop.go +++ b/components/local-app/cmd/workspace-stop.go @@ -60,6 +60,8 @@ var workspaceStopCommand = &cobra.Command{ return err } + defer stream.Close() + slog.Info("waiting for workspace to stop...") previousStatus := "" diff --git a/components/local-app/pkg/helper/workspace.go b/components/local-app/pkg/helper/workspace.go index f75e84c3747562..1e422b5cc51102 100644 --- a/components/local-app/pkg/helper/workspace.go +++ b/components/local-app/pkg/helper/workspace.go @@ -188,6 +188,8 @@ func ObserveWorkspaceUntilStarted(ctx context.Context, clnt *client.Gitpod, work continue } + defer stream.Close() + for stream.Receive() { msg := stream.Msg() if msg == nil {