Add a system modeler to scheduler

So it can try to predict the effect its bindings will have.
This commit is contained in:
Daniel Smith
2015-03-12 17:28:00 -07:00
parent 6319f8a568
commit 992d78a32e
8 changed files with 377 additions and 26 deletions

View File

@@ -342,6 +342,15 @@ func MapPodsToMachines(lister PodLister) (map[string][]api.Pod, error) {
return map[string][]api.Pod{}, err
}
for _, scheduledPod := range pods {
// TODO: switch to Spec.Host! There was some confusion previously
// about whether components should judge a pod's location
// based on spec.Host or status.Host. It has been decided that
// spec.Host is the canonical location of the pod. Status.Host
// will either be removed, be a copy, or in theory it could be
// used as a signal that kubelet has agreed to run the pod.
//
// This could be fixed now, but just requires someone to try it
// and verify that e2e still passes.
host := scheduledPod.Status.Host
machineToPods[host] = append(machineToPods[host], scheduledPod)
}