mirror of
https://github.com/containers/podman.git
synced 2025-10-12 16:56:32 +08:00
podman ps: show exposed ports under PORTS as well
Docker shows exposed ports as just PORT/PROTO so match that behavior. It is not clear to me why someone needs that information in ps as "expose" doesn't effect anything networking related. Fixes https://issues.redhat.com/browse/RHEL-32154 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
47
pkg/ps/ps.go
47
pkg/ps/ps.go
@ -238,29 +238,30 @@ func ListContainerBatch(rt *libpod.Runtime, ctr *libpod.Container, opts entities
|
||||
}
|
||||
|
||||
ps := entities.ListContainer{
|
||||
AutoRemove: ctr.AutoRemove(),
|
||||
CIDFile: conConfig.Spec.Annotations[define.InspectAnnotationCIDFile],
|
||||
Command: conConfig.Command,
|
||||
Created: conConfig.CreatedTime,
|
||||
ExitCode: exitCode,
|
||||
Exited: exited,
|
||||
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},
|
||||
Networks: networks,
|
||||
Pid: pid,
|
||||
Pod: conConfig.Pod,
|
||||
Ports: portMappings,
|
||||
Restarts: restartCount,
|
||||
Size: size,
|
||||
StartedAt: startedTime.Unix(),
|
||||
State: conState.String(),
|
||||
Status: healthStatus,
|
||||
AutoRemove: ctr.AutoRemove(),
|
||||
CIDFile: conConfig.Spec.Annotations[define.InspectAnnotationCIDFile],
|
||||
Command: conConfig.Command,
|
||||
Created: conConfig.CreatedTime,
|
||||
ExitCode: exitCode,
|
||||
Exited: exited,
|
||||
ExitedAt: exitedTime.Unix(),
|
||||
ExposedPorts: conConfig.ExposedPorts,
|
||||
ID: conConfig.ID,
|
||||
Image: conConfig.RootfsImageName,
|
||||
ImageID: conConfig.RootfsImageID,
|
||||
IsInfra: conConfig.IsInfra,
|
||||
Labels: conConfig.Labels,
|
||||
Mounts: ctr.UserVolumes(),
|
||||
Names: []string{conConfig.Name},
|
||||
Networks: networks,
|
||||
Pid: pid,
|
||||
Pod: conConfig.Pod,
|
||||
Ports: portMappings,
|
||||
Restarts: restartCount,
|
||||
Size: size,
|
||||
StartedAt: startedTime.Unix(),
|
||||
State: conState.String(),
|
||||
Status: healthStatus,
|
||||
}
|
||||
if opts.Pod && len(conConfig.Pod) > 0 {
|
||||
podName, err := rt.GetPodName(conConfig.Pod)
|
||||
|
Reference in New Issue
Block a user