mirror of https://github.com/containers/podman.git
ps: do not loop over port protocol
This can never included a comma in the protocol so it just complicated
things for no reason, we never needed this and commit edc3dc5e11
already
ensures this cannot happen.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
71c9744f72
commit
73fb6623cd
|
@ -497,17 +497,14 @@ func portsToString(ports []types.PortMapping, exposedPorts map[uint16][]string)
|
||||||
if hostIP == "" {
|
if hostIP == "" {
|
||||||
hostIP = "0.0.0.0"
|
hostIP = "0.0.0.0"
|
||||||
}
|
}
|
||||||
protocols := strings.Split(port.Protocol, ",")
|
if port.Range > 1 {
|
||||||
for _, protocol := range protocols {
|
fmt.Fprintf(sb, "%s:%d-%d->%d-%d/%s, ",
|
||||||
if port.Range > 1 {
|
hostIP, port.HostPort, port.HostPort+port.Range-1,
|
||||||
fmt.Fprintf(sb, "%s:%d-%d->%d-%d/%s, ",
|
port.ContainerPort, port.ContainerPort+port.Range-1, port.Protocol)
|
||||||
hostIP, port.HostPort, port.HostPort+port.Range-1,
|
} else {
|
||||||
port.ContainerPort, port.ContainerPort+port.Range-1, protocol)
|
fmt.Fprintf(sb, "%s:%d->%d/%s, ",
|
||||||
} else {
|
hostIP, port.HostPort,
|
||||||
fmt.Fprintf(sb, "%s:%d->%d/%s, ",
|
port.ContainerPort, port.Protocol)
|
||||||
hostIP, port.HostPort,
|
|
||||||
port.ContainerPort, protocol)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue