-
Notifications
You must be signed in to change notification settings - Fork 236
feat: cache update on update control #2789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
41eb66f
80495e1
5d662b8
2d6a2a1
935637c
08e1b34
c1775a9
bc2cf5b
0d49575
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -457,14 +457,35 @@ default boolean previousAnnotationForDependentResourcesEventFiltering() { | |
| * logic, and you want to further minimize the amount of work done / updates issued by the | ||
| * operator. | ||
| * | ||
| * @return if resource version should be parsed (as integer) | ||
| * @since 4.5.0 | ||
| * @return if resource version should be parsed (as integer) | ||
| * @return if resourceVersion should be parsed (as integer) | ||
| */ | ||
| default boolean parseResourceVersionsForEventFilteringAndCaching() { | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * If you update the primary resource from the reconciler with or without {@link | ||
| * io.javaoperatorsdk.operator.api.reconciler.UpdateControl} it is not guaranteed that for the | ||
| * next reconciliation will receive the most up-to-date resource. This is a consequence of | ||
| * Informers design in the Operator pattern. | ||
| * | ||
| * <p>The framework can be smart about it and make such guarantees, but this can be done | ||
|
||
| * absolutely reliably only if it bends some rules of the Kubernetes API contract. Thus, if we | ||
| * parse the resourceVersion of a primary resource as an integer and compare it with the version | ||
| * of the resource in the cache. Note that this is a gray area, since with default setup Etcd | ||
| * guarantees such monotonically increasing resource versions. But since it is still bending the | ||
| * rules by default, this feature is turned off, and work only if {@link | ||
| * #parseResourceVersionsForEventFilteringAndCaching} is also set to true. | ||
| * | ||
| * <p>See also {@link io.javaoperatorsdk.operator.api.reconciler.PrimaryUpdateAndCacheUtils} | ||
| * | ||
| * @return if the framework should cache the updated resource for next reconciliation | ||
| */ | ||
| default boolean cacheUpdatedResourcesViaUpdateControl() { | ||
|
||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * {@link io.javaoperatorsdk.operator.api.reconciler.UpdateControl} patch resource or status can | ||
| * either use simple patches or SSA. Setting this to {@code true}, controllers will use SSA for | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't really make sense. What's the point of referring to UpdateControl if that can happen whether we use it or not?