Skip to content

Conversation

csviri
Copy link
Collaborator

@csviri csviri commented Aug 11, 2025

Adds option to trigger reconciliation on all events.

Signed-off-by: Attila Mészáros [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 Aug 11, 2025
@csviri csviri linked an issue Aug 11, 2025 that may be closed by this pull request
@csviri csviri changed the title feat: all-event mode feat: all-event reconcile mode Aug 11, 2025
@csviri csviri changed the base branch from main to next August 11, 2025 10:35
@csviri csviri changed the title feat: all-event reconcile mode feat: reconcile-all-event mode Aug 11, 2025
@csviri
Copy link
Collaborator Author

csviri commented Aug 21, 2025

@metacosm @xstefank I will add a bunch of unit tests, and docs, but the core of it is ready. Pls take a look, thank you.

@csviri csviri requested review from metacosm and xstefank August 21, 2025 14:50
@csviri csviri changed the title feat: reconcile-all-event mode feat: allow to propagate all event to reconiler Sep 3, 2025
@csviri csviri changed the title feat: allow to propagate all event to reconiler feat: trigger reconciler on all event Sep 4, 2025
@csviri csviri changed the title feat: trigger reconciler on all event feat: triggering reconciler on all event Sep 4, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 16, 2025
@csviri csviri changed the title feat: triggering reconciler on all event feat: option to triggering reconciler on all events Sep 17, 2025
@csviri csviri marked this pull request as ready for review September 17, 2025 11:39
@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 Sep 17, 2025
@csviri
Copy link
Collaborator Author

csviri commented Sep 17, 2025

@xstefank @metacosm This feature is ready now, please review it. Happy to give also a tour together in case that is needed. thank you

@metacosm
Copy link
Collaborator

As mentioned in the issue, I'd rather see this supported via listeners than via yet another feature flag.

@csviri
Copy link
Collaborator Author

csviri commented Sep 17, 2025

As mentioned in the issue, I'd rather see this supported via listeners than via yet another feature flag.

The idea behind this is same as controllers work in go, having a separate listernet would not be an eleant solution, basically we just trigger reconiliation for all the events as in go is done by default. This way we don't need an another interface or any other construct.

@csviri
Copy link
Collaborator Author

csviri commented Sep 17, 2025

As mentioned in the issue, I'd rather see this supported via listeners than via yet another feature flag.

Also in the past on purpose reduced the number of those interaces, and I think that was the right choice. I'm not that happy about to much feature flags, but I see this the as the better option now, since it is closed to go; feature flags use can much easier see than a new interface. And note that this is nost just about the delete events, but all the events, for example when others have finalizers added to the custom resources, it is marked for deletion, but meanwhile updated (or just on the mar of deletion event) so acutally much harder to capture with an interface. I really think this is a better model just to have to trigger the reconciler on everthing than having separate methods.

@metacosm
Copy link
Collaborator

Following the go SDK should only been done where it makes sense. I don't think it's a particularly compelling argument for this particular design or the other flags that have been introduced lately.

Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
@csviri
Copy link
Collaborator Author

csviri commented Oct 2, 2025

@metacosm @xstefank can I merge this?

@metacosm
Copy link
Collaborator

metacosm commented Oct 2, 2025

Reviewing again but could you please add comments / explanations on the integration test?

Copy link
Collaborator

@xstefank xstefank left a comment

Choose a reason for hiding this comment

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

Other than this LGTM

csviri and others added 5 commits October 2, 2025 16:15
…tor/processing/event/ResourceState.java

Co-authored-by: Martin Stefanko <[email protected]>
…tor/processing/event/source/controller/ResourceDeleteEvent.java

Co-authored-by: Martin Stefanko <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
@csviri csviri requested review from metacosm and xstefank October 2, 2025 14:33
Signed-off-by: Attila Mészáros <[email protected]>
@csviri
Copy link
Collaborator Author

csviri commented Oct 3, 2025

Reviewing again but could you please add comments / explanations on the integration test?

Added comments / explanations for the tests. Thank you!

I'm also thinking to later do an additional PR, with more samples and guides.
We are more writing the docs as reference documentation now, but might be good to have some guides section.
cc @xstefank

csviri and others added 2 commits October 3, 2025 12:06
…tor/api/reconciler/PrimaryUpdateAndCacheUtils.java

Co-authored-by: Martin Stefanko <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
@metacosm
Copy link
Collaborator

metacosm commented Oct 6, 2025

Reviewing again but could you please add comments / explanations on the integration test?

Added comments / explanations for the tests. Thank you!

I'm also thinking to later do an additional PR, with more samples and guides. We are more writing the docs as reference documentation now, but might be good to have some guides section. cc @xstefank

Thank you for the added comments, however, what I was after was more comments as to what the reconciliation logic is and what it's trying to show as this is the most important part to understand what the test is trying to achieve.

*
* @return true Delete event received for primary resource
*/
boolean isPrimaryResourceDeleted();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: add @SInCE here and below?

* By settings to true, reconcile method will be triggered on every event, thus even for Delete
* event. You cannot use {@link Cleaner} or managed dependent resources in that case. See
* documentation for further details.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: add @SInCE?

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.

Option to trigger reconciler on all event
4 participants