mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Make scheduler to watch PodSpec.Host instead Status.Host
This commit is contained in:
@@ -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"),
|
||||
},
|
||||
}
|
||||
|
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user