Skip to content

Migrate event recording to Flux events v1 API#1510

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

Migrate event recording to Flux events v1 API#1510
adri1197 wants to merge 1 commit into
fluxcd:mainfrom
adri1197:event-recorder

Conversation

@adri1197

@adri1197 adri1197 commented Jun 6, 2026

Copy link
Copy Markdown

This PR migrates the controller's event recording from the legacy k8s.io/client-go/tools/record interface to github.com/fluxcd/pkg/runtime/events, which emits structured events.k8s.io/v1 Events.

  • Replace kuberecorder.EventRecorder with events.EventRecorder throughout the reconciler and action reconcilers
  • Add Source field to reconcile.Request so events include a Related object reference pointing to the source (HelmChart, OCIRepository, etc.).
  • Use structured event fields: Action (install, upgrade, rollback, etc.) and Related instead of encoding everything in the message string.
  • Migrate from github.com/fluxcd/pkg/apis/event/v1beta1 to github.com/fluxcd/pkg/apis/event/v1
  • Remove internal/testutil/FakeRecorder in favor of events.NewFakeRecorder from fluxcd/pkg/runtime/events
  • Update all tests to assert on eventsv1.Event fields (Note, Action, Regarding, Related) instead of corev1.Event.Message

Closes fluxcd/flux2#5761

Replace k8s.io/client-go/tools/record with the Flux events recorder which emits events.k8s.io/v1 Events with structured fields (Action, Related). Add Source to reconcile.Request so events reference the originating source object. Remove the internal FakeRecorder, using events.FakeRecorder from fluxcd/pkg instead

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.

Implement Kubernetes Event API v1

1 participant