remove unmapped ports from inspect port bindings

Signed-off-by: Jakob Ahrer <jakob@ahrer.dev>
This commit is contained in:
Jakob Ahrer
2022-12-13 17:46:52 +01:00
committed by SoMuchForSubtlety
parent 0037bffbb1
commit 97f63da67d
6 changed files with 49 additions and 5 deletions

View File

@ -554,7 +554,7 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named
// Port bindings.
// Only populate if we're using CNI to configure the network.
if c.config.CreateNetNS {
hostConfig.PortBindings = makeInspectPortBindings(c.config.PortMappings, c.config.ExposedPorts)
hostConfig.PortBindings = makeInspectPortBindings(c.config.PortMappings)
} else {
hostConfig.PortBindings = make(map[string][]define.InspectHostPort)
}