Add exec io copy
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
f431bf4ad4
commit
10c5a0ab3d
1 changed files with 14 additions and 0 deletions
14
shim/exec.go
14
shim/exec.go
|
@ -60,6 +60,20 @@ func newExecProcess(context context.Context, r *apishim.ExecRequest, parent *ini
|
||||||
if err := parent.runc.Exec(context, parent.id, processFromRequest(r), opts); err != nil {
|
if err := parent.runc.Exec(context, parent.id, processFromRequest(r), opts); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if socket != nil {
|
||||||
|
console, err := socket.ReceiveMaster()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
e.console = console
|
||||||
|
if err := copyConsole(context, console, r.Stdin, r.Stdout, r.Stderr, &e.WaitGroup); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := copyPipes(context, io, r.Stdin, r.Stdout, r.Stderr, &e.WaitGroup); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
pid, err := runc.ReadPidFile(opts.PidFile)
|
pid, err := runc.ReadPidFile(opts.PidFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue