Skip to content

docs: improve PrimaryUpdateAndCacheUtils documentation #2818

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/content/en/docs/documentation/reconciler.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public UpdateControl<StatusPatchCacheCustomResource> reconcile(
var freshCopy = createFreshCopy(primary);
freshCopy.getStatus().setValue(statusWithState());

// for this purpose using the utils instead of UpdateControl
var updatedResource = PrimaryUpdateAndCacheUtils.ssaPatchStatusAndCacheResource(resource, freshCopy, context);

return UpdateControl.noUpdate();
Expand All @@ -213,5 +214,9 @@ Note that it is not necessarily the same version returned as response from the u
can do additional updates meanwhile. However, unless it has been explicitly modified, that
resource will contain the up-to-date status.

Note that you can also do additional updates after the `PrimaryUpdateAndCacheUtils.*PatchStatusAndCacheResource` is called.
Either call the utils again or an update via UpdateControl.
It is still guaranteed that on next reconciliation not older than the resource update by `PrimaryUpdateAndCacheUtils` will be present.


See related integration test [here](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/statuscache).