From a6ed4723d52320741775dfc77fb7c2e52de6f14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sun, 25 May 2025 11:22:52 +0200 Subject: [PATCH 1/3] docs: improve PrimaryUpdateAndCacheUtils docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- docs/content/en/docs/documentation/reconciler.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/content/en/docs/documentation/reconciler.md b/docs/content/en/docs/documentation/reconciler.md index fa51399de7..3c63560221 100644 --- a/docs/content/en/docs/documentation/reconciler.md +++ b/docs/content/en/docs/documentation/reconciler.md @@ -201,6 +201,7 @@ public UpdateControl 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(); @@ -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, +calling the utils again or 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). From d31155263f95bfe6ad231f3b3d04871c54b0df9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Sun, 25 May 2025 11:24:01 +0200 Subject: [PATCH 2/3] wording MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- docs/content/en/docs/documentation/reconciler.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/documentation/reconciler.md b/docs/content/en/docs/documentation/reconciler.md index 3c63560221..3e9bb7a711 100644 --- a/docs/content/en/docs/documentation/reconciler.md +++ b/docs/content/en/docs/documentation/reconciler.md @@ -214,8 +214,8 @@ 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, -calling the utils again or UpdateControl. +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. From a25fcdd7cd33057ac6030dcb57e924c2c3e57b44 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Mon, 26 May 2025 08:53:13 +0200 Subject: [PATCH 3/3] docs: improve Signed-off-by: Chris Laprun --- docs/content/en/docs/documentation/reconciler.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/content/en/docs/documentation/reconciler.md b/docs/content/en/docs/documentation/reconciler.md index 3e9bb7a711..6444e70c7c 100644 --- a/docs/content/en/docs/documentation/reconciler.md +++ b/docs/content/en/docs/documentation/reconciler.md @@ -201,9 +201,9 @@ public UpdateControl 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); - + + // the resource was updated transparently via the utils, no further action is required via UpdateControl in this case return UpdateControl.noUpdate(); } ``` @@ -214,9 +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. - +Note that you can also perform additional updates after the `PrimaryUpdateAndCacheUtils.*PatchStatusAndCacheResource` is +called, either by calling any of the `PrimeUpdateAndCacheUtils` methods again or via `UpdateControl`. Using +`PrimaryUpdateAndCacheUtils` guarantees that the next reconciliation will see a resource state no older than the version +updated via `PrimaryUpdateAndCacheUtils`. 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).