Skip to content

Commit 3c86379

Browse files
authored
docs: minor comment on impl (#2355)
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 4f342e2 commit 3c86379

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/updatermatcher/GenericResourceUpdaterMatcher.java

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public R updateResource(R actual, R desired, Context<?> context) {
3030
Map<String, Object> actualMap = kubernetesSerialization.convertValue(actual, Map.class);
3131
Map<String, Object> desiredMap = kubernetesSerialization.convertValue(desired, Map.class);
3232
// replace all top level fields from actual with desired, but merge metadata separately
33+
// note that this ensures that `resourceVersion` is present, therefore optimistic
34+
// locking will happen on server side
3335
var metadata = actualMap.remove(METADATA);
3436
actualMap.replaceAll((k, v) -> desiredMap.get(k));
3537
actualMap.putAll(desiredMap);

0 commit comments

Comments
 (0)