Skip to content

Commit

Permalink
fix(controller): Increate default EventSpamBurst in Eventrecorder (#4698
Browse files Browse the repository at this point in the history
)

Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
  • Loading branch information
sarabala1979 committed Dec 10, 2020
1 parent 96a55ce commit 9669aa5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion workflow/events/event_recorder_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"k8s.io/client-go/tools/record"
)

// by default, allow a source to send 10000 events about an object
const defaultSpamBurst = 10000

type EventRecorderManager interface {
Get(namespace string) record.EventRecorder
}
Expand All @@ -28,7 +31,8 @@ func (m *eventRecorderManager) Get(namespace string) record.EventRecorder {
if ok {
return eventRecorder
}
eventBroadcaster := record.NewBroadcaster()
eventCorrelationOption := record.CorrelatorOptions{BurstSize: defaultSpamBurst}
eventBroadcaster := record.NewBroadcasterWithCorrelatorOptions(eventCorrelationOption)
eventBroadcaster.StartLogging(log.Debugf)
eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: m.kubernetes.CoreV1().Events(namespace)})
m.eventRecorders[namespace] = eventBroadcaster.NewRecorder(scheme.Scheme, apiv1.EventSource{Component: "workflow-controller"})
Expand Down

0 comments on commit 9669aa5

Please sign in to comment.