1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Show container wait error

If container wait has failed, show an error from the engine
and return an appropriate exit code.

This requires engine changes from https://github.com/moby/moby/pull/34999

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 8471742a8a
Component: cli
This commit is contained in:
Kir Kolyshkin
2017-10-19 00:56:01 +00:00
parent a67c7bc0ee
commit f77854ac3c

View File

@@ -37,7 +37,12 @@ func waitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID s
go func() {
select {
case result := <-resultC:
statusC <- int(result.StatusCode)
if result.Error != nil {
logrus.Errorf("Error waiting for container: %v", result.Error.Message)
statusC <- 125
} else {
statusC <- int(result.StatusCode)
}
case err := <-errC:
logrus.Errorf("error waiting for container: %v", err)
statusC <- 125