Do not read all IO if container is not started.
Signed-off-by: Volodymyr Burenin <vburenin@gmail.com>
This commit is contained in:
parent
328e30dc67
commit
72034dad40
1 changed files with 4 additions and 2 deletions
|
@ -242,8 +242,6 @@ var runCommand = cli.Command{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Ensure we read all io
|
|
||||||
defer fwg.Wait()
|
|
||||||
|
|
||||||
response, err := containers.Create(gocontext.Background(), create)
|
response, err := containers.Create(gocontext.Background(), create)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -254,6 +252,10 @@ var runCommand = cli.Command{
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure we read all io only if container started successfully.
|
||||||
|
defer fwg.Wait()
|
||||||
|
|
||||||
status, err := waitContainer(events, response)
|
status, err := waitContainer(events, response)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue