Skip to content

Commit 8e1d104

Browse files
committed
wip
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 0d31c34 commit 8e1d104

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,19 @@ <R extends HasMetadata> R resourcePatch(
970970
if (options.requiresMatcher() && matcher == null) {
971971
throw new IllegalArgumentException("Mode : " + options.mode + " requires matcher");
972972
}
973+
// this is to cover special case for jsonPatch were we should use actual resource as base
974+
var targetBaseResource = desiredResource != null ? desiredResource : actualResource;
973975
if (matches) {
976+
if (log.isDebugEnabled()) {
977+
log.debug(
978+
"Resource match resource id: {}, type: {}, version: {}",
979+
ResourceID.fromResource(targetBaseResource),
980+
targetBaseResource.getClass().getSimpleName(),
981+
targetBaseResource.getMetadata().getResourceVersion());
982+
}
974983
return actualResource;
975984
}
976-
// this is to cover special case for jsonPatch were we should use actual resource as base
977-
var targetBaseResource = desiredResource != null ? desiredResource : actualResource;
985+
978986
boolean optimisticLocking = targetBaseResource.getMetadata().getResourceVersion() != null;
979987

980988
if (options.getMode() == Mode.CACHE_ONLY

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/source/informer/ManagedInformerEventSource.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ public R eventFilteringUpdateAndCacheResource(R resourceToUpdate, UnaryOperator<
141141

142142
@Experimental(API_MIGHT_CHANGE)
143143
public R updateAndCacheResource(R resourceToUpdate, UnaryOperator<R> updateOperation) {
144+
if (log.isDebugEnabled()) {
145+
log.debug(
146+
"Updating and caching resource without filtering. id: {} type: {}",
147+
ResourceID.fromResource(resourceToUpdate),
148+
resourceType());
149+
}
144150
var result = updateOperation.apply(resourceToUpdate);
145151
handleRecentResourceUpdate(ResourceID.fromResource(resourceToUpdate), result, resourceToUpdate);
146152
return result;

0 commit comments

Comments
 (0)