Add exec io copy

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-01-26 16:07:43 -08:00
parent f431bf4ad4
commit 10c5a0ab3d

View file

@ -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 {
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)
if err != nil {
return nil, err