podman inspect show exposed ports

Podman inspect has to show exposed ports to match docker. This requires
storing the exposed ports in the container config.
A exposed port is shown as `"80/tcp": null` while a forwarded port is
shown as `"80/tcp": [{"HostIp": "", "HostPort": "8080" }]`.

Also make sure to add the exposed ports to the new image when the
container is commited.

Fixes #10777

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2021-08-24 10:23:10 +02:00
parent 2de56a5f41
commit 4b2dc48d0b
12 changed files with 110 additions and 24 deletions

View File

@ -616,7 +616,7 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) {
infraConfig.Networks = append(infraConfig.Networks, p.config.InfraContainer.Networks...)
}
infraConfig.NetworkOptions = p.config.InfraContainer.NetworkOptions
infraConfig.PortBindings = makeInspectPortBindings(p.config.InfraContainer.PortBindings)
infraConfig.PortBindings = makeInspectPortBindings(p.config.InfraContainer.PortBindings, nil)
}
inspectData := define.InspectPodData{