Skip to content

Commit 935637c

Browse files
committed
flag
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 2d6a2a1 commit 935637c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,24 @@ default boolean parseResourceVersionsForEventFilteringAndCaching() {
464464
return false;
465465
}
466466

467+
/**
468+
* If you update the primary resource from the reconciler with or without {@link
469+
* io.javaoperatorsdk.operator.api.reconciler.UpdateControl} it is not guaranteed that for the
470+
* next reconciliation will receive the most up-to-date resource. This is a consequence of
471+
* Informers design in the Operator pattern.
472+
*
473+
* <p>The framework can be smart about it and make such guarantees, but this can be done
474+
* absolutely reliably only if it bends some rules of the Kubernetes API contract. Thus, if we
475+
* parse the resourceVersion of a primary resource as an integer and compare it with the version
476+
* of the resource in the cache. Note that this is a gray area, since with default setup Etcd
477+
* guarantees such monotonically increasing resource versions. But since it is still bending the
478+
* rules by default, this feature is turned off, and work only if {@link
479+
* #parseResourceVersionsForEventFilteringAndCaching} is also set to true.
480+
*
481+
* <p>See also {@link io.javaoperatorsdk.operator.api.reconciler.PrimaryUpdateAndCacheUtils}
482+
*
483+
* @return if the framework should cache the updated resource for next reconciliation
484+
*/
467485
default boolean cacheUpdatedResourcesViaUpdateControl() {
468486
return false;
469487
}

0 commit comments

Comments
 (0)