Merge pull request #25206 from yifan-gu/fix_hostport

rkt: When host port is zero, we should not forward the port.
This commit is contained in:
Robert Bailey 2016-05-06 13:43:56 -07:00
commit 71706e0ad5

View File

@ -749,6 +749,9 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, c api.Container, pullSecrets [
// Set global ports.
for _, port := range opts.PortMappings {
if port.HostPort == 0 {
continue
}
manifest.Ports = append(manifest.Ports, appctypes.ExposedPort{
Name: convertToACName(port.Name),
HostPort: uint(port.HostPort),