mirror of
https://github.com/containers/podman.git
synced 2025-08-05 19:02:37 +08:00
Handle --rm when starting a container
podman start should follow the same behaviour as podman run when removing a container. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
37
pkg/ps/ps.go
37
pkg/ps/ps.go
@ -179,24 +179,25 @@ func ListContainerBatch(rt *libpod.Runtime, ctr *libpod.Container, opts entities
|
||||
}
|
||||
|
||||
ps := entities.ListContainer{
|
||||
Command: conConfig.Command,
|
||||
Created: conConfig.CreatedTime,
|
||||
Exited: exited,
|
||||
ExitCode: exitCode,
|
||||
ExitedAt: exitedTime.Unix(),
|
||||
ID: conConfig.ID,
|
||||
Image: conConfig.RootfsImageName,
|
||||
ImageID: conConfig.RootfsImageID,
|
||||
IsInfra: conConfig.IsInfra,
|
||||
Labels: conConfig.Labels,
|
||||
Mounts: ctr.UserVolumes(),
|
||||
Names: []string{conConfig.Name},
|
||||
Pid: pid,
|
||||
Pod: conConfig.Pod,
|
||||
Ports: portMappings,
|
||||
Size: size,
|
||||
StartedAt: startedTime.Unix(),
|
||||
State: conState.String(),
|
||||
AutoRemove: ctr.AutoRemove(),
|
||||
Command: conConfig.Command,
|
||||
Created: conConfig.CreatedTime,
|
||||
Exited: exited,
|
||||
ExitCode: exitCode,
|
||||
ExitedAt: exitedTime.Unix(),
|
||||
ID: conConfig.ID,
|
||||
Image: conConfig.RootfsImageName,
|
||||
ImageID: conConfig.RootfsImageID,
|
||||
IsInfra: conConfig.IsInfra,
|
||||
Labels: conConfig.Labels,
|
||||
Mounts: ctr.UserVolumes(),
|
||||
Names: []string{conConfig.Name},
|
||||
Pid: pid,
|
||||
Pod: conConfig.Pod,
|
||||
Ports: portMappings,
|
||||
Size: size,
|
||||
StartedAt: startedTime.Unix(),
|
||||
State: conState.String(),
|
||||
}
|
||||
if opts.Pod && len(conConfig.Pod) > 0 {
|
||||
podName, err := rt.GetName(conConfig.Pod)
|
||||
|
Reference in New Issue
Block a user