Fixed pod anti-affinity bugs.

This commit is contained in:
Klaus Ma
2017-01-17 13:28:54 +08:00
parent 32e163c928
commit c184fef6e6
2 changed files with 84 additions and 7 deletions

View File

@@ -1033,7 +1033,7 @@ func getMatchingAntiAffinityTerms(pod *v1.Pod, nodeInfoMap map[string]*scheduler
func (c *PodAffinityChecker) getMatchingAntiAffinityTerms(pod *v1.Pod, allPods []*v1.Pod) ([]matchingPodAntiAffinityTerm, error) {
var result []matchingPodAntiAffinityTerm
for _, existingPod := range allPods {
affinity := pod.Spec.Affinity
affinity := existingPod.Spec.Affinity
if affinity != nil && affinity.PodAntiAffinity != nil {
existingPodNode, err := c.info.GetNodeInfo(existingPod.Spec.NodeName)
if err != nil {