Merge pull request #27141 from freehan/hpfix

Automatic merge from submit-queue

only handled non host network pods for hostports in kubenet

attempt to fix: #27118
pull/6/head
k8s-merge-robot 2016-06-09 22:08:10 -07:00 committed by GitHub
commit 805a0aae71
1 changed files with 2 additions and 1 deletions

View File

@ -613,7 +613,8 @@ func (plugin *kubenetNetworkPlugin) gatherAllHostports() (map[api.ContainerPort]
}
// Need the complete api.Pod object
pod, ok := plugin.host.GetPodByName(p.Namespace, p.Name)
if ok {
// kubenet should not handle hostports for hostnetwork pods
if ok && !pod.Spec.SecurityContext.HostNetwork {
for _, container := range pod.Spec.Containers {
for _, port := range container.Ports {
if port.HostPort != 0 {