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

@@ -274,7 +274,7 @@ func (s activePods) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s activePods) Less(i, j int) bool {
// Unassigned < assigned
if s[i].Spec.Host == "" && s[j].Spec.Host != "" {
if s[i].Spec.NodeName == "" && s[j].Spec.NodeName != "" {
return true
}
// PodPending < PodUnknown < PodRunning

View File

@@ -436,19 +436,19 @@ func TestSortingActivePods(t *testing.T) {
pods[i] = &podList.Items[i]
}
// pods[0] is not scheduled yet.
pods[0].Spec.Host = ""
pods[0].Spec.NodeName = ""
pods[0].Status.Phase = api.PodPending
// pods[1] is scheduled but pending.
pods[1].Spec.Host = "bar"
pods[1].Spec.NodeName = "bar"
pods[1].Status.Phase = api.PodPending
// pods[2] is unknown.
pods[2].Spec.Host = "foo"
pods[2].Spec.NodeName = "foo"
pods[2].Status.Phase = api.PodUnknown
// pods[3] is running but not ready.
pods[3].Spec.Host = "foo"
pods[3].Spec.NodeName = "foo"
pods[3].Status.Phase = api.PodRunning
// pods[4] is running and ready.
pods[4].Spec.Host = "foo"
pods[4].Spec.NodeName = "foo"
pods[4].Status.Phase = api.PodRunning
pods[4].Status.Conditions = []api.PodCondition{{Type: api.PodReady, Status: api.ConditionTrue}}