Expose Shutdown func for EventBroadcaster

Kubernetes-commit: 57d43e4946f352f075b219b0a2f35942b06cfeb9
This commit is contained in:
Ted Yu
2019-10-07 08:58:38 -07:00
committed by Kubernetes Publisher
parent 911ef75fbc
commit c4ea3eed4f
3 changed files with 14 additions and 0 deletions

View File

@@ -127,6 +127,9 @@ type EventBroadcaster interface {
// NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster
// with the event source set to the given event source.
NewRecorder(scheme *runtime.Scheme, source v1.EventSource) EventRecorder
// Shutdown shuts down the broadcaster
Shutdown()
}
// Creates a new event broadcaster.
@@ -169,6 +172,10 @@ func (eventBroadcaster *eventBroadcasterImpl) StartRecordingToSink(sink EventSin
})
}
func (e *eventBroadcasterImpl) Shutdown() {
e.Broadcaster.Shutdown()
}
func recordToSink(sink EventSink, event *v1.Event, eventCorrelator *EventCorrelator, sleepDuration time.Duration) {
// Make a copy before modification, because there could be multiple listeners.
// Events are safe to copy like this.