Make scheduler to watch PodSpec.Host instead Status.Host

This commit is contained in:
Wojciech Tyczynski
2015-03-12 13:38:58 +01:00
parent a3fd0a9fd5
commit 9f2f10d6db
9 changed files with 12 additions and 13 deletions

View File

@@ -300,7 +300,7 @@ func TestListPodListSelection(t *testing.T) {
})},
{Value: runtime.EncodeOrDie(latest.Codec, &api.Pod{
ObjectMeta: api.ObjectMeta{Name: "bar"},
Status: api.PodStatus{Host: "barhost"},
Spec: api.PodSpec{Host: "barhost"},
})},
{Value: runtime.EncodeOrDie(latest.Codec, &api.Pod{
ObjectMeta: api.ObjectMeta{Name: "baz"},
@@ -341,13 +341,13 @@ func TestListPodListSelection(t *testing.T) {
field: "status.phase=Failed",
expectedIDs: util.NewStringSet("baz"),
}, {
field: "status.host=barhost",
field: "spec.host=barhost",
expectedIDs: util.NewStringSet("bar"),
}, {
field: "status.host=",
field: "spec.host=",
expectedIDs: util.NewStringSet("foo", "baz", "qux", "zot"),
}, {
field: "status.host!=",
field: "spec.host!=",
expectedIDs: util.NewStringSet("bar"),
},
}

View File

@@ -133,8 +133,8 @@ func MatchPod(label labels.Selector, field fields.Selector) generic.Matcher {
func PodToSelectableFields(pod *api.Pod) labels.Set {
return labels.Set{
"name": pod.Name,
"spec.host": pod.Spec.Host,
"status.phase": string(pod.Status.Phase),
"status.host": pod.Status.Host,
}
}