mirror of https://github.com/docker/cli.git
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>
This commit is contained in:
parent
718a245b6e
commit
8471742a8a
|
@ -37,7 +37,12 @@ func waitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID s
|
||||||
go func() {
|
go func() {
|
||||||
select {
|
select {
|
||||||
case result := <-resultC:
|
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:
|
case err := <-errC:
|
||||||
logrus.Errorf("error waiting for container: %v", err)
|
logrus.Errorf("error waiting for container: %v", err)
|
||||||
statusC <- 125
|
statusC <- 125
|
||||||
|
|
Loading…
Reference in New Issue