Skip to content

runtime: Migrate to new Kubernentes event API#1144

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

runtime: Migrate to new Kubernentes event API#1144
adri1197 wants to merge 1 commit intofluxcd:mainfrom
adri1197:event-api

Conversation

@adri1197
Copy link

@adri1197 adri1197 commented Mar 8, 2026

Event Recorder implementation to fully support the Kubernetes Events API events.k8s.io/v1 (replacing k8s.io/client-go/tools/record to k8s.io/client-go/tools/events module). The recorder implements the events.EventRecorder interface, enabling compatibility with modern Kubernetes event handling while maintaining backward compatibility for existing webhook-based notifications.

Closes fluxcd/flux2#5761

@stefanprodan stefanprodan added the area/runtime Controller runtime related issues and pull requests label Mar 8, 2026
@stefanprodan stefanprodan changed the title Migrate to new Kubernentes event API runtime: Migrate to new Kubernentes event API Mar 8, 2026
@matheuscscp
Copy link
Member

What's the minimum k8s version for this to work?

Copy link
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

The lib should support related and let callers decide whether or not to use it

@matheuscscp
Copy link
Member

The lib should support related and let callers decide whether or not to use it

We should also add related as a constant in fluxcd/pkg/apis/event and send the related object reference under this field to notification-controller

@adri1197
Copy link
Author

adri1197 commented Mar 9, 2026

What's the minimum k8s version for this to work?

Looks like it became GA in 1.19 - KEP-383

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

Please undo all changes to events/v1beta1 and add events/v1.

Also go.mod changes are unrelated, please undo.

@adri1197
Copy link
Author

adri1197 commented Mar 9, 2026

Shall the naming conventions be aligned, events/v1 with the upstream k8s.io/api/events/v1 (Event type)? On top of the new field additions, I’ve noticed that several ones have been renamed (e.g., InvolvedObject becoming Regarding).

Table (KEP-383)

image

@adri1197 adri1197 force-pushed the event-api branch 2 times, most recently from 70e41ea to 7532591 Compare March 10, 2026 10:11
@adri1197 adri1197 force-pushed the event-api branch 2 times, most recently from 7ebb1d7 to d51ad46 Compare March 11, 2026 12:00
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

area/runtime Controller runtime related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation new K8s Events API - v1

3 participants