Merge pull request #1459 from crosbymichael/exec-wait

Wait on exec process not task
This commit is contained in:
Phil Estes 2017-09-01 12:12:28 -04:00 committed by GitHub
commit a3f0bbaac1

View File

@ -70,7 +70,7 @@ var taskExecCommand = cli.Command{
} }
defer process.Delete(ctx) defer process.Delete(ctx)
statusC, err := task.Wait(ctx) statusC, err := process.Wait(ctx)
if err != nil { if err != nil {
return err return err
} }
@ -83,9 +83,6 @@ var taskExecCommand = cli.Command{
return err return err
} }
} }
if err := process.Start(ctx); err != nil {
return err
}
if tty { if tty {
if err := handleConsoleResize(ctx, process, con); err != nil { if err := handleConsoleResize(ctx, process, con); err != nil {
logrus.WithError(err).Error("console resize") logrus.WithError(err).Error("console resize")
@ -94,6 +91,10 @@ var taskExecCommand = cli.Command{
sigc := forwardAllSignals(ctx, process) sigc := forwardAllSignals(ctx, process)
defer stopCatch(sigc) defer stopCatch(sigc)
} }
if err := process.Start(ctx); err != nil {
return err
}
status := <-statusC status := <-statusC
code, _, err := status.Result() code, _, err := status.Result()
if err != nil { if err != nil {