Fix for issue #22932 infinite pod restarts

This fixes an issue when using CNI where the hash of a Container object will differ between creation and change checks due to the docker image exporting ports
This commit is contained in:
tobad357 2016-03-16 21:36:41 +08:00
parent b873836f71
commit 3d530f7f37

View File

@ -807,7 +807,7 @@ func (dm *DockerManager) podInfraContainerChanged(pod *api.Pod, podInfraContaine
glog.V(4).Infof("host: %v, %v", pod.Spec.SecurityContext.HostNetwork, networkMode)
return true, nil
}
} else {
} else if dm.networkPlugin.Name() != "cni" && dm.networkPlugin.Name() != "kubenet" {
// Docker only exports ports from the pod infra container. Let's
// collect all of the relevant ports and export them.
for _, container := range pod.Spec.Containers {