Skip to content

Migrate event recorder to event/v1#2011

Draft
adri1197 wants to merge 1 commit intofluxcd:mainfrom
adri1197:event-recorder
Draft

Migrate event recorder to event/v1#2011
adri1197 wants to merge 1 commit intofluxcd:mainfrom
adri1197:event-recorder

Conversation

@adri1197
Copy link

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.EventRecorder with fluxcd/pkg/runtime/events.EventRecorder across all controllers and the summarize package.
  • Update event API import from fluxcd/pkg/apis/event/v1beta1 to fluxcd/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

Encapsulated under fluxcd/pkg/runtime/events

Signed-off-by: Adrian Fernandez De La Torre <adri1197@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation new K8s Events API - v1

1 participant