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

@@ -357,6 +357,9 @@ func (recorder *recorderImpl) generateEvent(object runtime.Object, annotations m
event := recorder.makeEvent(ref, annotations, eventtype, reason, message)
event.Source = recorder.source
event.ReportingInstance = recorder.source.Host
event.ReportingController = recorder.source.Component
// NOTE: events should be a non-blocking operation, but we also need to not
// put this in a goroutine, otherwise we'll race to write to a closed channel
// when we go to shut down this broadcaster. Just drop events if we get overloaded,