diff --git a/vendor.conf b/vendor.conf index aa69c40..3dcb6e8 100644 --- a/vendor.conf +++ b/vendor.conf @@ -1,5 +1,5 @@ # go-runc client for runc; master as of 01/20/2017 -github.com/crosbymichael/go-runc d300412371ca6865a40bd4559599bb370889e2aa +github.com/crosbymichael/go-runc 706de6f422f397fb70b8c98f9b8c8eab2de32ae2 # console pkg; github.com/crosbymichael/console 4bf9d88357031b516b3794a2594b6d060a29c59c # go-metrics client to prometheus; master as of 12/16/2016 diff --git a/vendor/github.com/crosbymichael/go-runc/runc.go b/vendor/github.com/crosbymichael/go-runc/runc.go index 3cb57a3..b228153 100644 --- a/vendor/github.com/crosbymichael/go-runc/runc.go +++ b/vendor/github.com/crosbymichael/go-runc/runc.go @@ -193,10 +193,27 @@ func (r *Runc) Exec(context context.Context, id string, spec specs.Process, opts args = append(args, oargs...) } cmd := r.command(context, append(args, id)...) - if opts != nil { + if opts != nil && opts.IO != nil { opts.Set(cmd) } - return runOrError(cmd) + if cmd.Stdout == nil && cmd.Stderr == nil { + data, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("%s: %s", err, data) + } + return nil + } + if err := cmd.Start(); err != nil { + return err + } + if opts != nil && opts.IO != nil { + if c, ok := opts.IO.(StartCloser); ok { + if err := c.CloseAfterStart(); err != nil { + return err + } + } + } + return cmd.Wait() } // Run runs the create, start, delete lifecycle of the container