Skip to content

Commit 874f545

Browse files
csvirimetacosm
andauthored
docs: improve PrimaryUpdateAndCacheUtils documentation (#2818)
Signed-off-by: Attila Mészáros <[email protected]> Signed-off-by: Chris Laprun <[email protected]> Co-authored-by: Chris Laprun <[email protected]>
1 parent f51c65b commit 874f545

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/content/en/docs/documentation/reconciler.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ public UpdateControl<StatusPatchCacheCustomResource> reconcile(
202202
freshCopy.getStatus().setValue(statusWithState());
203203

204204
var updatedResource = PrimaryUpdateAndCacheUtils.ssaPatchStatusAndCacheResource(resource, freshCopy, context);
205-
205+
206+
// the resource was updated transparently via the utils, no further action is required via UpdateControl in this case
206207
return UpdateControl.noUpdate();
207208
}
208209
```
@@ -213,5 +214,9 @@ Note that it is not necessarily the same version returned as response from the u
213214
can do additional updates meanwhile. However, unless it has been explicitly modified, that
214215
resource will contain the up-to-date status.
215216

217+
Note that you can also perform additional updates after the `PrimaryUpdateAndCacheUtils.*PatchStatusAndCacheResource` is
218+
called, either by calling any of the `PrimeUpdateAndCacheUtils` methods again or via `UpdateControl`. Using
219+
`PrimaryUpdateAndCacheUtils` guarantees that the next reconciliation will see a resource state no older than the version
220+
updated via `PrimaryUpdateAndCacheUtils`.
216221

217222
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).

0 commit comments

Comments
 (0)