// MapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names
// and the values are the list of pods running on that host.
MapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names
and the values are the list of pods running on that host.
// MapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names // and the values are the list of pods running on that host .
func MapPodsToMachines(lister PodLister) (map[string][]api.Pod, error) {
	machineToPods := map[string][]api.Pod{}
	pods, err := lister.ListPods(labels.Everything())
	if err != nil {
		return map[string][]api.Pod{}, err
	}
	for _, scheduledPod := range pods {
		host := scheduledPod.CurrentState.Host
		machineToPods[host] = append(machineToPods[host], scheduledPod)
	}
	return machineToPods, nil
}
func MapPodsToMachines ( lister PodLister ) ( map [ string ] [ ] api . Pod , error ) { machineToPods := map [ string ] [ ] api . Pod { } pods , err := lister . ListPods ( labels . Everything ( ) ) if err != nil { return map [ string ] [ ] api . Pod { } , err } for _ , scheduledPod := range pods { host := scheduledPod . CurrentState . Host machineToPods [ host ] = append ( machineToPods [ host ] , scheduledPod ) } return machineToPods , nil }
MapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names
and the values are the list of pods running on that host.
MapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names and the values are the list of pods running on that host .
// TODO: perform more targeted query...