parse the exec flags from request query (#510)
This commit is contained in:
@@ -26,12 +26,25 @@ func PodExecHandlerFunc(backend remotecommand.Executor) http.HandlerFunc {
|
|||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
command := q["command"]
|
command := q["command"]
|
||||||
|
|
||||||
// TODO: tty flag causes remotecommand.createStreams to wait for the wrong number of streams
|
var stdin, stdout, stderr, tty bool
|
||||||
|
if q.Get("stdin") == "true" {
|
||||||
|
stdin = true
|
||||||
|
}
|
||||||
|
if q.Get("stdout") == "true" {
|
||||||
|
stdout = true
|
||||||
|
}
|
||||||
|
if q.Get("stderr") == "true" {
|
||||||
|
stderr = true
|
||||||
|
}
|
||||||
|
if q.Get("tty") == "true" {
|
||||||
|
tty = true
|
||||||
|
}
|
||||||
|
|
||||||
streamOpts := &remotecommand.Options{
|
streamOpts := &remotecommand.Options{
|
||||||
Stdin: true,
|
Stdin: stdin,
|
||||||
Stdout: true,
|
Stdout: stdout,
|
||||||
Stderr: true,
|
Stderr: stderr,
|
||||||
TTY: false,
|
TTY: tty,
|
||||||
}
|
}
|
||||||
|
|
||||||
idleTimeout := time.Second * 30
|
idleTimeout := time.Second * 30
|
||||||
|
|||||||
Reference in New Issue
Block a user