mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Add pod condition PodScheduled to detect situation
when scheduler tried to schedule a Pod, but failed. Ref #24404
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user