From 72034dad40f9924a5c6f04005868f152286a287e Mon Sep 17 00:00:00 2001 From: Volodymyr Burenin Date: Mon, 6 Mar 2017 13:43:31 -0600 Subject: [PATCH] Do not read all IO if container is not started. Signed-off-by: Volodymyr Burenin --- cmd/ctr/run.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/ctr/run.go b/cmd/ctr/run.go index 2fbc0ff..726d658 100644 --- a/cmd/ctr/run.go +++ b/cmd/ctr/run.go @@ -242,8 +242,6 @@ var runCommand = cli.Command{ if err != nil { return err } - // Ensure we read all io - defer fwg.Wait() response, err := containers.Create(gocontext.Background(), create) if err != nil { @@ -254,6 +252,10 @@ var runCommand = cli.Command{ }); err != nil { return err } + + // Ensure we read all io only if container started successfully. + defer fwg.Wait() + status, err := waitContainer(events, response) if err != nil { return err