mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
Address review comments and fix ps output
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
@ -548,6 +548,8 @@ func getTemplateOutput(psParams []psJSONParams, opts shared.PsOptions) ([]psTemp
|
||||
labels := formatLabels(psParam.Labels)
|
||||
|
||||
switch psParam.Status {
|
||||
case libpod.ContainerStateExited.String():
|
||||
fallthrough
|
||||
case libpod.ContainerStateStopped.String():
|
||||
exitedSince := units.HumanDuration(time.Since(psParam.ExitedAt))
|
||||
status = fmt.Sprintf("Exited (%d) %s ago", psParam.ExitCode, exitedSince)
|
||||
|
@ -332,9 +332,9 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool)
|
||||
label.ReleaseLabel(c.ProcessLabel())
|
||||
r.reserveLabels()
|
||||
}
|
||||
// Delete the container
|
||||
// Only do this if we're not ContainerStateConfigured - if we are,
|
||||
// we haven't been created in the runtime yet
|
||||
// Delete the container.
|
||||
// Not needed in Configured and Exited states, where the container
|
||||
// doesn't exist in the runtime
|
||||
if c.state.State != ContainerStateConfigured &&
|
||||
c.state.State != ContainerStateExited {
|
||||
if err := c.delete(ctx); err != nil {
|
||||
|
Reference in New Issue
Block a user