Merge pull request #2478 from baude/portbz1683734

podman port fix output
This commit is contained in:
OpenShift Merge Robot
2019-02-28 10:03:13 -08:00
committed by GitHub

View File

@ -128,9 +128,6 @@ func portCmd(c *cliconfig.PortValues) error {
if state, _ := con.State(); state != libpod.ContainerStateRunning {
continue
}
if c.All {
fmt.Println(con.ID())
}
portmappings, err := con.PortMappings()
if err != nil {
@ -143,6 +140,9 @@ func portCmd(c *cliconfig.PortValues) error {
if hostIP == "" {
hostIP = "0.0.0.0"
}
if c.All {
fmt.Printf("%s\t", con.ID()[:12])
}
// If not searching by port or port/proto, then dump what we see
if port == "" {
fmt.Printf("%d/%s -> %s:%d\n", v.ContainerPort, v.Protocol, hostIP, v.HostPort)