Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller): Increase default EventSpamBurst in Event-recorder #4698

Merged
merged 2 commits into from
Dec 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will support to trigger WorkflowSucceeded event if the workflow has 10000 steps. This change won't the default EventAggregator config.


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