Migrate event recorder to event/v1 by adri1197 · Pull Request #2011 · fluxcd/source-controller
Migrate the source-controller event recorder from event/v1beta1 to event/v1, using the events.EventRecorder interface from fluxcd/pkg/runtime/events.
Changes
- Replace
k8s.io/client-go/tools/record.EventRecorderwithfluxcd/pkg/runtime/events.EventRecorderacross all controllers and the summarize package. - Update event API import from
fluxcd/pkg/apis/event/v1beta1tofluxcd/pkg/apis/event/v1. - Adapt all Eventf and AnnotatedEventf call sites to the new v1 signature, which requires additional action and reportingController parameters.
- Inline the mustSetupEventRecorder helper in main.go since the new events.NewRecorder returns a different type.
- Update all corresponding test files to use the new recorder interface.
Motivation
The event/v1beta1 API is being deprecated in favor of event/v1.
Closes fluxcd/flux2#5761