mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Report hook output on error
Fixes #733 This reports the stdout/err for a hook if it returns a non-zero exit status. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -307,7 +307,11 @@ func (c Command) Run(s HookState) error {
|
||||
}
|
||||
errC := make(chan error, 1)
|
||||
go func() {
|
||||
errC <- cmd.Run()
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
err = fmt.Errorf("%s: %s", err, out)
|
||||
}
|
||||
errC <- err
|
||||
}()
|
||||
if c.Timeout != nil {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user