[v0.15] - Event recorder interface migration#4966
Merged
0xavi0 merged 2 commits intoApr 15, 2026
Merged
Conversation
* Fix event recorder interface migration The migration from `controller-runtime`'s `record.EventRecorder` to `events.EventRecorder` seems to have changed the type of events generated, which led to permissions errors when recording events. This commit updates Fleet's gitOps RBAC to take that new event type into account. * Add regression end-to-end test for event generation Single-cluster end-to-end tests for GitRepo deployments now validate that `GotNewCommit` events are generated, which should help catch future event recording-related issues.
thardeck
approved these changes
Apr 14, 2026
* Migrate events generation to new interface With `GetEentRecorderFor` being deprecated, controllers now use the new `GetEventRecorder` method, returning an `events.EventRecorder` instead of a `record.EventRecorder` interface. * Fix expectations on source component When using the new event recorder interface, the recorder does not populate the source component anymore; instead, the emitter can be checked through `ReportingController`. Besides, job creation and deletion actually happen _twice_ when re-creating a job. * Use formatting placeholders for errors in events This should prevent events from containing malformed messages, if error messages ever contain `%` symbols.
37c1646 to
871a718
Compare
p-se
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR backports 2 PRs that in conjunction migrate the event recorder to use the new interface.
If includes the PR that migrates the recorder and the PR that fixes RBAC issues.
Backport of: #4896
Backport of: #4678
Refers to: #4965
Refers to: #4765
Additional Information
Checklist
- [ ] I have updated the documentation via a pull request in the fleet-product-docs repository.