GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: record events about any object and outside reconciliations by afalhambra-hivemq · Pull Request #3690 · operator-framework/java-operator-sdk

Conversation

@afalhambra-hivemq

@afalhambra-hivemq afalhambra-hivemq commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The recorder could only record about the primary resource, from inside a reconciliation. Events about any object (a child controller recording on its parent, for example) and recording outside of a reconciliation through the registered controller.

context.eventRecorder(parent).warn("ChildFailed", "could not reconcile child " + name);

registeredController.eventRecorder().record(parent, EventRecord.normal("Noticed", "something happened"));

context.eventRecorder() works as before. The low level API (experimental) changed: a custom EventRecorder implements record(HasMetadata, EventRecord, ControllerConfiguration<?>), the Context based methods are gone, and EventSink and toEvent take the ControllerConfiguration instead of the Context. All in the 5.7 migration guide, plus a new docs page for the recorder.

Left out on purpose: the related field of events, nothing in kubectl shows it and it would need to be part of the event identity. Follow-up if someone needs it.

Fixes #3686

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@afalhambra-hivemq
feat: record events about any object and outside reconciliations
eff720b
Signed-off-by: Antonio Fernandez Alhambra <[email protected]>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 11, 2026
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9caf0bcb-5cca-4f22-af5a-f23175a3d2ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@afalhambra-hivemq
afalhambra-hivemq marked this pull request as ready for review November 11, 2026 11:49
Copilot AI balanced review requested due to automatic review settings November 11, 2026 11:49
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 11, 2026
@openshift-ci
openshift-ci Bot requested review from csviri and xstefank November 11, 2026 11:50
Copilot started reviewing on behalf of afalhambra-hivemq November 11, 2026 11:50
View session
Copilot AI reviewed Nov 11, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the event-recorder changes.

No open issues 🎉

What changed in this PR

Extends Java Operator SDK’s event recorder to support arbitrary target objects and recording outside reconciliation loops, addressing #3686 while preserving context.eventRecorder() usage.

Changes:

  • Adds controller-bound recorders and a context overload for recording events about other objects.
  • Refactors the experimental recorder and sink APIs to accept explicit resources and controller configuration.
  • Adds coverage for the new entry points and documents usage, permissions, and migration steps.
File Description
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​eventrecorder/​EventRecorderReconciler.java Records events about a separate ConfigMap for integration coverage.
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​eventrecorder/​EventRecorderIT.java Tests other-object and outside-reconciliation recording.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​processing/​ControllerTest.java Verifies controller-bound delegation and default recording behavior.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​reconciler/​DefaultContextTest.java Tests primary-resource and explicit-object binding.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​event/​EventRecorderTest.java Tests default bound views and argument validation.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​event/​EventRecorderRegressionTest.java Migrates regression tests to the explicit-resource API.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​event/​DefaultEventRecorderTest.java Covers arbitrary targets, binding, and event identity.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​event/​DefaultEventRecorderIntegrationTest.java Updates API-server tests for the revised signatures.
operator-framework-core/​src/​test/​java/​io/​javaoperatorsdk/​operator/​api/​config/​ConfigurationServiceOverriderTest.java Adapts the custom recorder fixture to the functional interface.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​RegisteredController.java Exposes a controller-bound event recorder.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​processing/​Controller.java Binds the configured recorder to the controller.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​reconciler/​DefaultContext.java Delegates recording through resource-bound views.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​reconciler/​Context.java Adds an event recorder overload for arbitrary objects.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​ResourceEventRecorder.java Clarifies object and controller binding in Javadoc.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​EventSink.java Replaces reconciliation context with controller configuration.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​EventRecorder.java Adds explicit-target recording and default binding methods.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​DefaultEventSink.java Adopts the updated sink signature.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​DefaultEventRecorder.java Assembles events from explicit objects and controller configuration.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​ControllerEventRecorder.java Defines the controller-bound recording API.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​BoundResourceEventRecorder.java Implements object-and-controller-bound delegation.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​event/​BoundControllerEventRecorder.java Implements controller-bound delegation and resource views.
operator-framework-core/​src/​main/​java/​io/​javaoperatorsdk/​operator/​api/​config/​ConfigurationService.java Updates Javadoc for shared recorder inputs.
docs/​content/​en/​docs/​migration/​v5-7-migration.md Documents experimental API changes and migration steps.
docs/​content/​en/​docs/​documentation/​operations/​configuration.md Links event configuration to the new guide.
docs/​content/​en/​docs/​documentation/​kubernetes-events.md Explains recording, aggregation, customization, failures, and permissions.
docs/​content/​en/​docs/​documentation/​_index.md Adds the event-recording guide to the documentation index.

Review effort: Balanced

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@afalhambra-hivemq
test: wait for the reconcile before deleting in the cleaner ITs
46d0b21
Signed-off-by: Antonio Fernandez Alhambra <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@csviri csviri Awaiting requested review from csviri
@xstefank xstefank Awaiting requested review from xstefank

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@afalhambra-hivemq
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.