Merge pull request #17291 from telday/main

[NO NEW TESTS NEEDED] Fixes port collision issue on use of --publish-all
This commit is contained in:
OpenShift Merge Robot
2023-01-31 07:51:19 -05:00
committed by GitHub

View File

@ -311,6 +311,8 @@ func ParsePortMapping(portMappings []types.PortMapping, exposePorts map[uint16][
return nil, err return nil, err
} }
portMappings = append(portMappings, p) portMappings = append(portMappings, p)
// Mark this port as used so it doesn't get re-generated
allPorts[p.HostPort] = true
} else { } else {
newProtocols = append(newProtocols, protocol) newProtocols = append(newProtocols, protocol)
} }