generate ReportingInstance and ReportingController in Event

Kubernetes-commit: df0a25382053bb6c0f04fc4d807be6e059b552c1
This commit is contained in:
HirazawaUi
2023-03-27 22:23:45 +08:00
committed by Kubernetes Publisher
parent a3b4cd32e5
commit 0a0ddf8b6b
3 changed files with 90 additions and 70 deletions

View File

@@ -115,6 +115,9 @@ func validateEvent(messagePrefix string, actualEvent *v1.Event, expectedEvent *v
// Temp clear time stamps for comparison because actual values don't matter for comparison
recvEvent.FirstTimestamp = expectedEvent.FirstTimestamp
recvEvent.LastTimestamp = expectedEvent.LastTimestamp
recvEvent.ReportingController = expectedEvent.ReportingController
// Check that name has the right prefix.
if n, en := recvEvent.Name, expectedEvent.Name; !strings.HasPrefix(n, en) {
t.Errorf("%v - Name '%v' does not contain prefix '%v'", messagePrefix, n, en)