Skip to content

Status update triggers reconciliation with finalizers disabled #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shawkins opened this issue Oct 8, 2021 · 5 comments
Closed

Status update triggers reconciliation with finalizers disabled #595

shawkins opened this issue Oct 8, 2021 · 5 comments

Comments

@shawkins
Copy link
Collaborator

shawkins commented Oct 8, 2021

Bug Report

When using @Controller(finalizerName = Controller.NO_FINALIZER) an update to just the status of the primary resource will itself cause another reconciliation - which is a fairly tight processing loop. With the finalizer enabled no event loop is seen.

What did you expect to see?

The status update will not trigger an immediate reconciliation.

What did you see instead? Under which circumstances?

Operator sdk version 1.9.6 via the 2.0.0.Beta5 quarkus extension.

Environment

Openshift 4.8

@shawkins
Copy link
Collaborator Author

shawkins commented Oct 8, 2021

@metacosm @lburgazzoli this may have been addressed with #457 I'm not entirely sure.

Until that change, the check at https://github.com/java-operator-sdk/java-operator-sdk/blob/ccf305301d8f9e9e88f31cd492def656f3453241/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/internal/CustomResourceEventSource.java#L131 will prevent a resource without a finalizer from updating the cache of generations seen, so the controller will immediately process an update event due to only a status change.

@shawkins
Copy link
Collaborator Author

shawkins commented Oct 8, 2021

I tried upgrading just the sdk dependency to 1.9.8 and confirmed that things worked as expected.

@csviri
Copy link
Collaborator

csviri commented Oct 9, 2021

Hi @shawkins , thank you for the report!
The finalizer should not be relevant to this.
The status update, although its a subresource, updates the custom resource also in sense, that the resourceVersion is updated for example. So naturally an event should be received. However to prevent reconciliation we filter on metadata.generation, in this case the generation is not increased and (if this not turned explicitly off) the reconciliation should not happen as you mention.

Do I understand correctly that it work as expected in a more recent version and we can close the issue?

@shawkins
Copy link
Collaborator Author

shawkins commented Oct 9, 2021

Do I understand correctly that it work as expected in a more recent version and we can close the issue?

If you are good with the explanation of why it was occurring and what has addressed it, yes it can be closed.

@csviri csviri closed this as completed Oct 11, 2021
@csviri
Copy link
Collaborator

csviri commented Oct 11, 2021

Will add an integration test regarding to this case.

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

No branches or pull requests

2 participants