Skip to content

Commit 40a61fa

Browse files
committed
add missing parameters for container and container_user
1 parent 72d3ff1 commit 40a61fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

coderd/workspaceapps/proxy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,8 @@ func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) {
653653
reconnect := parser.RequiredNotEmpty("reconnect").UUID(values, uuid.New(), "reconnect")
654654
height := parser.UInt(values, 80, "height")
655655
width := parser.UInt(values, 80, "width")
656+
container := parser.String(values, "", "container")
657+
containerUser := parser.String(values, "", "container_user")
656658
if len(parser.Errors) > 0 {
657659
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
658660
Message: "Invalid query parameters.",
@@ -690,7 +692,10 @@ func (s *Server) workspaceAgentPTY(rw http.ResponseWriter, r *http.Request) {
690692
}
691693
defer release()
692694
log.Debug(ctx, "dialed workspace agent")
693-
ptNetConn, err := agentConn.ReconnectingPTY(ctx, reconnect, uint16(height), uint16(width), r.URL.Query().Get("command"))
695+
ptNetConn, err := agentConn.ReconnectingPTY(ctx, reconnect, uint16(height), uint16(width), r.URL.Query().Get("command"), func(arp *workspacesdk.AgentReconnectingPTYInit) {
696+
arp.Container = container
697+
arp.ContainerUser = containerUser
698+
})
694699
if err != nil {
695700
log.Debug(ctx, "dial reconnecting pty server in workspace agent", slog.Error(err))
696701
_ = conn.Close(websocket.StatusInternalError, httpapi.WebsocketCloseSprintf("dial: %s", err))

0 commit comments

Comments
 (0)