Skip to content

Conversation

@shawkins
Copy link
Collaborator

@shawkins shawkins commented Jan 6, 2026

A few ideas for simplifying the logic.

@openshift-ci openshift-ci bot requested review from csviri and metacosm January 6, 2026 20:15
@shawkins shawkins marked this pull request as draft January 6, 2026 20:16
@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 Jan 6, 2026

private int activeUpdates = 0;
private ResourceEvent lastEvent;
private int lastUpdatedResourceVersion = -1;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we can generally guarentee that the resource versions will fall in the int range.

int comp = 0;
if (cached != null) {
comp = ReconcileUtils.validateAndCompareResourceVersions(resource, cached);
if (comp >= 0 || unknownState) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@csviri can you explain why this allows for equality?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we can remove the resource in that case from the cache.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, so this needs refined a little further - it should remove, but still be seen as a known event.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that in the implementation we strictly define two cases: when we want to filter the event and when we don't, based on user's intention.
So there is no grey area now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The wording may be confusing across a couple of methods.

The boolean used to mean "known event" - so if I put a version into the temporary resource cache, then see the event with the same version, it's a known event.

Does "filter event" have a subtely different meaning from "known event"?

Copy link
Collaborator

@csviri csviri Jan 8, 2026

Choose a reason for hiding this comment

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

Hmm good question, the filter event mean to express that the event won't be propagated further (if true). This is bit more descriptive since we might actually not know all the events (watch connection issues).

@csviri csviri force-pushed the reconcile-utils-new-alg branch from 7b46752 to be8f5f7 Compare January 8, 2026 13:34
@csviri csviri force-pushed the reconcile-utils-new-alg branch from ef2642a to df5ade4 Compare January 8, 2026 13:44
@shawkins shawkins force-pushed the reconcile-utils-new-alg branch from be8f5f7 to 630cde5 Compare January 8, 2026 14:59
@csviri csviri force-pushed the reconcile-utils-new-alg branch from 630cde5 to be8f5f7 Compare January 8, 2026 15:04
@shawkins shawkins closed this Jan 8, 2026
@shawkins shawkins force-pushed the reconcile-utils-new-alg branch from df5ade4 to f414063 Compare January 8, 2026 15:10
@shawkins shawkins mentioned this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants