Rebasing onto latest code and fixing issues

This commit is contained in:
Abhishek Gupta 2015-01-13 09:52:37 -08:00
parent c20d062d16
commit dbac18a909
2 changed files with 5 additions and 6 deletions

View File

@ -259,7 +259,7 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod api.Pod, existingPods []api.P
// just use the first service and get the other pods within the service // just use the first service and get the other pods within the service
// TODO: a separate predicate can be created that tries to handle all services for the pod // TODO: a separate predicate can be created that tries to handle all services for the pod
selector := labels.SelectorFromSet(services[0].Spec.Selector) selector := labels.SelectorFromSet(services[0].Spec.Selector)
servicePods, err := s.podLister.ListPods(selector) servicePods, err := s.podLister.List(selector)
if err != nil { if err != nil {
return false, err return false, err
} }

View File

@ -32,9 +32,8 @@ func NewServiceSpreadPriority(serviceLister ServiceLister) PriorityFunction {
return serviceSpread.CalculateSpreadPriority return serviceSpread.CalculateSpreadPriority
} }
// CalculateSpreadPriority spreads pods by minimizing the number of pods on the same machine with the same labels. // CalculateSpreadPriority spreads pods by minimizing the number of pods belonging to the same service
// Importantly, if there are services in the system that span multiple heterogenous sets of pods, this spreading priority // on the same machine.
// may not provide optimal spreading for the members of that Service.
func (s *ServiceSpread) CalculateSpreadPriority(pod api.Pod, podLister PodLister, minionLister MinionLister) (HostPriorityList, error) { func (s *ServiceSpread) CalculateSpreadPriority(pod api.Pod, podLister PodLister, minionLister MinionLister) (HostPriorityList, error) {
var maxCount int var maxCount int
var pods []api.Pod var pods []api.Pod
@ -45,7 +44,7 @@ func (s *ServiceSpread) CalculateSpreadPriority(pod api.Pod, podLister PodLister
// just use the first service and get the other pods within the service // just use the first service and get the other pods within the service
// TODO: a separate predicate can be created that tries to handle all services for the pod // TODO: a separate predicate can be created that tries to handle all services for the pod
selector := labels.SelectorFromSet(services[0].Spec.Selector) selector := labels.SelectorFromSet(services[0].Spec.Selector)
pods, err = podLister.ListPods(selector) pods, err = podLister.List(selector)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -105,7 +104,7 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod api.Pod, podList
// just use the first service and get the other pods within the service // just use the first service and get the other pods within the service
// TODO: a separate predicate can be created that tries to handle all services for the pod // TODO: a separate predicate can be created that tries to handle all services for the pod
selector := labels.SelectorFromSet(services[0].Spec.Selector) selector := labels.SelectorFromSet(services[0].Spec.Selector)
pods, err = podLister.ListPods(selector) pods, err = podLister.List(selector)
if err != nil { if err != nil {
return nil, err return nil, err
} }