Add handling of old non-capitalized event reason to scheduler-predicates test
This commit is contained in:
		| @@ -110,6 +110,22 @@ func verifyResult(c *client.Client, podName string, ns string) { | |||||||
| 			"reason":                   "FailedScheduling", | 			"reason":                   "FailedScheduling", | ||||||
| 		}.AsSelector()) | 		}.AsSelector()) | ||||||
| 	expectNoError(err) | 	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 | 	printed := false | ||||||
| 	printOnce := func(msg string) string { | 	printOnce := func(msg string) string { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 gmarek
					gmarek