Skip to content

Commit 1210765

Browse files
committed
adding back the comparison with a todo
1 parent f621fc9 commit 1210765

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,14 @@ public synchronized void putResource(T newResource, String previousResourceVersi
9494
resourceId,
9595
newResource.getMetadata().getResourceVersion(),
9696
latest);
97-
} else {
97+
return;
98+
}
99+
100+
var cachedResource = managedInformerEventSource.get(resourceId).orElse(null);
101+
102+
if (cachedResource == null ||
103+
// TODO: this check may not be necessary if concurrent sdk updates to single resource are not possible
104+
newResource.getMetadata().getResourceVersion() > cachedResource.getMetadata().getResourceVersion()) {
98105
log.debug(
99106
"Temporarily moving ahead to target version {} for resource id: {}",
100107
newResource.getMetadata().getResourceVersion(),

0 commit comments

Comments
 (0)