Skip to content

Commit 4fa4fe6

Browse files
committed
improve: remove JSON Patch from PrimaryUpdateAndCacheUtils
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 <[email protected]>
1 parent 63bbec5 commit 4fa4fe6

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/PrimaryUpdateAndCacheUtils.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,7 @@ public static <P extends HasMetadata> P patchAndCacheStatus(P primary, Context<P
5353
return patchAndCacheStatus(
5454
primary, context, () -> context.getClient().resource(primary).patchStatus());
5555
}
56-
57-
/**
58-
* Makes sure that the up-to-date primary resource will be present during the next reconciliation.
59-
* Using JSON Patch.
60-
*
61-
* @param primary resource
62-
* @param context of reconciliation
63-
* @return updated resource
64-
* @param <P> primary resource type
65-
*/
66-
public static <P extends HasMetadata> P editAndCacheStatus(
67-
P primary, Context<P> context, UnaryOperator<P> operation) {
68-
logWarnIfResourceVersionPresent(primary);
69-
return patchAndCacheStatus(
70-
primary, context, () -> context.getClient().resource(primary).editStatus(operation));
71-
}
72-
56+
7357
/**
7458
* Makes sure that the up-to-date primary resource will be present during the next reconciliation.
7559
*

0 commit comments

Comments
 (0)