Add pod condition PodScheduled to detect situation

when scheduler tried to schedule a Pod, but failed.

Ref #24404
This commit is contained in:
Filip Grzadkowski
2016-04-18 14:26:16 +02:00
parent 26c99fee00
commit a80b1798c4
9 changed files with 106 additions and 6 deletions

View File

@@ -43,6 +43,12 @@ type fakeBinder struct {
func (fb fakeBinder) Bind(binding *api.Binding) error { return fb.b(binding) }
type fakePodConditionUpdater struct{}
func (fc fakePodConditionUpdater) Update(pod *api.Pod, podCondition *api.PodCondition) error {
return nil
}
func podWithID(id, desiredHost string) *api.Pod {
return &api.Pod{
ObjectMeta: api.ObjectMeta{Name: id, SelfLink: testapi.Default.SelfLink("pods", id)},
@@ -128,6 +134,7 @@ func TestScheduler(t *testing.T) {
gotBinding = b
return item.injectBindError
}},
PodConditionUpdater: fakePodConditionUpdater{},
Error: func(p *api.Pod, err error) {
gotPod = p
gotError = err