Add handling of old non-capitalized event reason to scheduler-predicates test

pull/6/head
gmarek 2015-10-20 15:28:08 +02:00
parent 41c32e84ee
commit bae456cb9d
1 changed files with 16 additions and 0 deletions

View File

@ -110,6 +110,22 @@ func verifyResult(c *client.Client, podName string, ns string) {
"reason": "FailedScheduling",
}.AsSelector())
expectNoError(err)
// If we failed to find event with a capitalized first letter of reason
// try looking for one starting with a small one for backward compatibility.
// If we don't do it we end up in #15806.
// TODO: remove this block when we don't care about supporting v1.0 too much.
if len(schedEvents.Items) == 0 {
schedEvents, err = c.Events(ns).List(
labels.Everything(),
fields.Set{
"involvedObject.kind": "Pod",
"involvedObject.name": podName,
"involvedObject.namespace": ns,
"source": "scheduler",
"reason": "failedScheduling",
}.AsSelector())
expectNoError(err)
}
printed := false
printOnce := func(msg string) string {