diff options
Diffstat (limited to 'cmd/podman/batchcontainer/container.go')
-rw-r--r-- | cmd/podman/batchcontainer/container.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/podman/batchcontainer/container.go b/cmd/podman/batchcontainer/container.go index de127c64d..e27914174 100644 --- a/cmd/podman/batchcontainer/container.go +++ b/cmd/podman/batchcontainer/container.go @@ -42,6 +42,7 @@ type BatchContainerStruct struct { Exited bool Pid int StartedTime time.Time + ExitedTime time.Time Size *ContainerSize } @@ -76,6 +77,7 @@ func BatchContainerOp(ctr *libpod.Container, opts PsOptions) (BatchContainerStru pid int size *ContainerSize startedTime time.Time + exitedTime time.Time ) batchErr := ctr.Batch(func(c *libpod.Container) error { @@ -93,6 +95,10 @@ func BatchContainerOp(ctr *libpod.Container, opts PsOptions) (BatchContainerStru if err != nil { logrus.Errorf("error getting started time for %q: %v", c.ID(), err) } + exitedTime, err = c.FinishedTime() + if err != nil { + logrus.Errorf("error getting exited time for %q: %v", c.ID(), err) + } if !opts.Size && !opts.Namespace { return nil @@ -132,6 +138,7 @@ func BatchContainerOp(ctr *libpod.Container, opts PsOptions) (BatchContainerStru Exited: exited, Pid: pid, StartedTime: startedTime, + ExitedTime: exitedTime, Size: size, }, nil } |