actions: minor bug fixes and improvements (#18904)

This commit is contained in:
Luiz Aoqui
2023-10-31 17:06:02 -04:00
committed by GitHub
parent 2bff6d2a6a
commit 3ddf1ecf1d
12 changed files with 254 additions and 108 deletions

View File

@@ -9,6 +9,7 @@ import (
"errors"
"fmt"
"io"
"net/url"
"strconv"
"sync"
"time"
@@ -25,6 +26,7 @@ const (
type execSession struct {
client *Client
alloc *Allocation
job string
task string
tty bool
command []string
@@ -101,7 +103,7 @@ func (s *execSession) startConnection() (*websocket.Conn, error) {
q.Params["action"] = s.action
q.Params["allocID"] = s.alloc.ID
q.Params["group"] = s.alloc.TaskGroup
reqPath = fmt.Sprintf("/v1/job/%s/action", s.alloc.JobID)
reqPath = fmt.Sprintf("/v1/job/%s/action", url.PathEscape(s.job))
}
var conn *websocket.Conn