update PodSpec.Host to PodSpec.NodeName in /pkg/api/types.go and /pkg/api/v1beta3/types.go

This commit is contained in:
Chao Xu
2015-05-22 16:40:57 -07:00
parent 9b67435cf3
commit 9c1153322e
45 changed files with 291 additions and 291 deletions

View File

@@ -189,10 +189,10 @@ func (n *NodeSelector) PodSelectorMatches(pod *api.Pod, existingPods []*api.Pod,
}
func PodFitsHost(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error) {
if len(pod.Spec.Host) == 0 {
if len(pod.Spec.NodeName) == 0 {
return true, nil
}
return pod.Spec.Host == node, nil
return pod.Spec.NodeName == node, nil
}
type NodeLabelChecker struct {
@@ -300,7 +300,7 @@ func (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api
}
if len(nsServicePods) > 0 {
// consider any service pod and fetch the minion its hosted on
otherMinion, err := s.nodeInfo.GetNodeInfo(nsServicePods[0].Spec.Host)
otherMinion, err := s.nodeInfo.GetNodeInfo(nsServicePods[0].Spec.NodeName)
if err != nil {
return false, err
}
@@ -369,7 +369,7 @@ func MapPodsToMachines(lister algorithm.PodLister) (map[string][]*api.Pod, error
return map[string][]*api.Pod{}, err
}
for _, scheduledPod := range pods {
host := scheduledPod.Spec.Host
host := scheduledPod.Spec.NodeName
machineToPods[host] = append(machineToPods[host], scheduledPod)
}
return machineToPods, nil