skip schedule deleting pod

Signed-off-by: forrestchen <forrestchen@tencent.com>

skip schedule deleting pod

Signed-off-by: forrestchen <forrestchen@tencent.com>
This commit is contained in:
forrestchen
2016-12-21 21:11:06 +08:00
parent 5356a16f01
commit e2a465ae68
2 changed files with 19 additions and 0 deletions

View File

@@ -59,6 +59,16 @@ func podWithID(id, desiredHost string) *v1.Pod {
}
}
func deletingPod(id string) *v1.Pod {
deletionTimestamp := metav1.Now()
return &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: id, SelfLink: testapi.Default.SelfLink("pods", id), DeletionTimestamp: &deletionTimestamp},
Spec: v1.PodSpec{
NodeName: "",
},
}
}
func podWithPort(id, desiredHost string, port int) *v1.Pod {
pod := podWithID(id, desiredHost)
pod.Spec.Containers = []v1.Container{
@@ -122,6 +132,10 @@ func TestScheduler(t *testing.T) {
expectError: errB,
expectErrorPod: podWithID("foo", ""),
eventReason: "FailedScheduling",
}, {
sendPod: deletingPod("foo"),
algo: mockScheduler{"", nil},
eventReason: "FailedScheduling",
},
}