rkt: When host port is zero, we should not forward the port.

This commit is contained in:
Yifan Gu 2016-05-04 19:02:39 -07:00
parent 83c121e921
commit 36f3185223

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),