Fix possible panic in PodAffinityChecker

This commit is contained in:
Ivan Shvedunov 2016-08-22 20:10:49 +03:00
parent 87b40782c9
commit f758cb418d

View File

@ -968,7 +968,7 @@ func (c *PodAffinityChecker) getMatchingAntiAffinityTerms(pod *api.Pod, allPods
if err != nil {
return nil, err
}
if affinity.PodAntiAffinity != nil {
if affinity != nil && affinity.PodAntiAffinity != nil {
existingPodNode, err := c.info.GetNodeInfo(existingPod.Spec.NodeName)
if err != nil {
return nil, err