mirror of
https://github.com/containers/podman.git
synced 2025-10-16 10:43:52 +08:00
remove unmapped ports from inspect port bindings
Signed-off-by: Jakob Ahrer <jakob@ahrer.dev>
This commit is contained in:

committed by
SoMuchForSubtlety

parent
0037bffbb1
commit
97f63da67d
@ -312,7 +312,12 @@ func writeHijackHeader(r *http.Request, conn io.Writer) {
|
||||
}
|
||||
|
||||
// Convert OCICNI port bindings into Inspect-formatted port bindings.
|
||||
func makeInspectPortBindings(bindings []types.PortMapping, expose map[uint16][]string) map[string][]define.InspectHostPort {
|
||||
func makeInspectPortBindings(bindings []types.PortMapping) map[string][]define.InspectHostPort {
|
||||
return makeInspectPorts(bindings, nil)
|
||||
}
|
||||
|
||||
// Convert OCICNI port bindings into Inspect-formatted port bindings with exposed, but not bound ports set to nil.
|
||||
func makeInspectPorts(bindings []types.PortMapping, expose map[uint16][]string) map[string][]define.InspectHostPort {
|
||||
portBindings := make(map[string][]define.InspectHostPort)
|
||||
for _, port := range bindings {
|
||||
protocols := strings.Split(port.Protocol, ",")
|
||||
|
Reference in New Issue
Block a user