From 028374b99e5c9dd23236a10495ea0aebe819b51f Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 13 Jul 2018 10:24:17 -0400 Subject: Record whether the container has exited Use this to supplement exit codes returned from containers, to make sure we know when exit codes are invalid (as the container has not yet exited) Signed-off-by: Matthew Heon --- cmd/podman/batchcontainer/container.go | 2 +- cmd/podman/ps.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/batchcontainer/container.go b/cmd/podman/batchcontainer/container.go index 09db4f8a2..76b10b633 100644 --- a/cmd/podman/batchcontainer/container.go +++ b/cmd/podman/batchcontainer/container.go @@ -75,7 +75,7 @@ func BatchContainerOp(ctr *libpod.Container, opts PsOptions) (BatchContainerStru return errors.Wrapf(err, "unable to obtain container state") } - exitCode, err = c.ExitCode() + exitCode, _, err = c.ExitCode() if err != nil { return errors.Wrapf(err, "unable to obtain container exit code") } diff --git a/cmd/podman/ps.go b/cmd/podman/ps.go index 49e43ffac..22055b274 100644 --- a/cmd/podman/ps.go +++ b/cmd/podman/ps.go @@ -324,7 +324,7 @@ func generateContainerFilterFuncs(filter, filterValue string, runtime *libpod.Ru return nil, errors.Wrapf(err, "exited code out of range %q", filterValue) } return func(c *libpod.Container) bool { - ec, err := c.ExitCode() + ec, _, err := c.ExitCode() if ec == int32(exitCode) && err == nil { return true } -- cgit v1.2.3-54-g00ecf