Merge pull request #4674 from abhgupta/abhgupta-dev

Configuring scheduler via json configuration file
This commit is contained in:
David Oppenheimer
2015-03-02 14:43:25 -08:00
13 changed files with 548 additions and 73 deletions

View File

@@ -135,6 +135,13 @@ func findNodesThatFit(pod api.Pod, podLister PodLister, predicates map[string]Fi
// All scores are finally combined (added) to get the total weighted scores of all minions
func prioritizeNodes(pod api.Pod, podLister PodLister, priorityConfigs []PriorityConfig, minionLister MinionLister) (HostPriorityList, error) {
result := HostPriorityList{}
// If no priority configs are provided, then the EqualPriority function is applied
// This is required to generate the priority list in the required format
if len(priorityConfigs) == 0 {
return EqualPriority(pod, podLister, minionLister)
}
combinedScores := map[string]int{}
for _, priorityConfig := range priorityConfigs {
weight := priorityConfig.Weight