Commit 71706e0a authored by Robert Bailey's avatar Robert Bailey

Merge pull request #25206 from yifan-gu/fix_hostport

rkt: When host port is zero, we should not forward the port.
parents caf6f06f 36f31852
...@@ -749,6 +749,9 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, c api.Container, pullSecrets [ ...@@ -749,6 +749,9 @@ func (r *Runtime) newAppcRuntimeApp(pod *api.Pod, c api.Container, pullSecrets [
// Set global ports. // Set global ports.
for _, port := range opts.PortMappings { for _, port := range opts.PortMappings {
if port.HostPort == 0 {
continue
}
manifest.Ports = append(manifest.Ports, appctypes.ExposedPort{ manifest.Ports = append(manifest.Ports, appctypes.ExposedPort{
Name: convertToACName(port.Name), Name: convertToACName(port.Name),
HostPort: uint(port.HostPort), HostPort: uint(port.HostPort),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment