From 4fa4fe6299de3433950bd069217620a965c704bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 13 May 2025 14:11:42 +0200 Subject: [PATCH 1/2] improve: remove JSON Patch from PrimaryUpdateAndCacheUtils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If no optimistic locking is used a list element removal might remove an not desired element if there was a concurrent element removal. Signed-off-by: Attila Mészáros --- .../reconciler/PrimaryUpdateAndCacheUtils.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java index 174f7667f6..328f7a1e74 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java @@ -53,23 +53,7 @@ public static

P patchAndCacheStatus(P primary, Context

context.getClient().resource(primary).patchStatus()); } - - /** - * Makes sure that the up-to-date primary resource will be present during the next reconciliation. - * Using JSON Patch. - * - * @param primary resource - * @param context of reconciliation - * @return updated resource - * @param

primary resource type - */ - public static

P editAndCacheStatus( - P primary, Context

context, UnaryOperator

operation) { - logWarnIfResourceVersionPresent(primary); - return patchAndCacheStatus( - primary, context, () -> context.getClient().resource(primary).editStatus(operation)); - } - + /** * Makes sure that the up-to-date primary resource will be present during the next reconciliation. * From 5c3daec77c090f44ec1fb86f3c03153fcc62385c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 13 May 2025 14:13:49 +0200 Subject: [PATCH 2/2] format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../operator/api/reconciler/PrimaryUpdateAndCacheUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java index 328f7a1e74..f508abf04f 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java @@ -53,7 +53,7 @@ public static

P patchAndCacheStatus(P primary, Context

context.getClient().resource(primary).patchStatus()); } - + /** * Makes sure that the up-to-date primary resource will be present during the next reconciliation. *