mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #15948 from gmarek/fix-test
Add handling of old non-capitalized event reason to scheduler-predicates test
This commit is contained in:
commit
722c86aa50
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user