Merge pull request #6761 from mheon/fix_ps_portmappings

Print port mappings in `ps` for ctrs sharing network
This commit is contained in:
OpenShift Merge Robot
2020-06-25 13:22:36 -04:00
committed by GitHub
2 changed files with 23 additions and 2 deletions

View File

@ -145,11 +145,15 @@ func ListContainerBatch(rt *libpod.Runtime, ctr *libpod.Container, opts entities
}
return nil
})
if batchErr != nil {
return entities.ListContainer{}, batchErr
}
portMappings, err := ctr.PortMappings()
if err != nil {
return entities.ListContainer{}, err
}
ps := entities.ListContainer{
Command: conConfig.Command,
Created: conConfig.CreatedTime.Unix(),
@ -165,7 +169,7 @@ func ListContainerBatch(rt *libpod.Runtime, ctr *libpod.Container, opts entities
Names: []string{conConfig.Name},
Pid: pid,
Pod: conConfig.Pod,
Ports: conConfig.PortMappings,
Ports: portMappings,
Size: size,
StartedAt: startedTime.Unix(),
State: conState.String(),