Repository navigation
feat(operator): add ReconcileStrategy (ByGeneration / ByResourceVersion) - #1088
Merged
Merged
Conversation
…yResourceVersion)␊ 2 ␊ 3 Co-Authored-By:·Claude·Sonnet·4.6·<noreply@anthropic.com>␊
…ings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ourceWatcher constructor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Explain `ByGenerationId` and `ByResourceVersion` strategies in detail. - Describe FusionCache integration, default in-memory configuration, and advanced distributed setup. - Add usage examples for configuring strategy-specific cache instances.
kimpenhaus
marked this pull request as ready for review
April 17, 2026 21:17
kimpenhaus
marked this pull request as draft
April 17, 2026 21:33
…ation` across codebase and docs
…t` property and update related tests - Removed `ReconcileStrategy_Should_Have_Expected_Values` test. - Adjusted `OnEventAsync` in `ResourceWatcher` to simplify logic flow. - Updated constructor dependencies for `NamespacedLeaderElectionResourceWatcher`.
- Verified cache names for ReconcileStrategy options. - Ensured custom cache configurator is invoked when provided.
…tcher - Updated XML doc to describe strategy-dependent deduplication tokens for `EntityCache`. - Provided details on cache behavior during finalizer processing and deletion scenarios.
- Updated documentation to specify that label/annotation changes never increment `generation` and status updates don't increment `generation` when a status subresource is enabled. - Adjusted XML comments and configuration docs to ensure consistent definitions across ReconcileStrategy and OperatorSettings.
…leStrategy` scenarios - Added coverage for cache-dependent enqueue behavior under `ByGeneration` and `ByResourceVersion` strategies. - Renamed test cases for clarity around strategy-specific logic.
…ersion` - Added guidance on preventing infinite loops by writing only when resource state changes. - Included example C# code highlighting proper guard usage during reconciliation.
…on` in `EntityCache` assignment
…ed related tests - Introduced `MakeImmutable` method to ensure `OperatorSettings` cannot be modified after the operator is built. - Updated property accessors in `OperatorSettings` to validate mutability. - Added unit tests to validate immutability behavior and mutation exceptions. - Ensured `AddKubernetesOperator` automatically sets `OperatorSettings` as immutable.
kimpenhaus
marked this pull request as ready for review
April 20, 2026 08:14
buehler
reviewed
Apr 22, 2026
buehler
approved these changes
Apr 22, 2026
This was referenced Jun 15, 2026
This was referenced Jun 23, 2026
This was referenced Jul 16, 2026
This was referenced Aug 10, 2026
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReconcileStrategyenum with two values:ByGeneration(default) andByResourceVersion.OperatorSettings.ReconcileStrategyproperty (default:ByGeneration, no breaking change).AddKubernetesOperatorOnEventAsyncbranches on the active strategy:ByGeneration: existing behavior - cachesmetadata.generation(long), skips events where generation did not increase, bypasses check whenDeletionTimestampis set.ByResourceVersion: cachesmetadata.resourceVersion(string), skips events where the version is unchanged, noDeletionTimestampbypass required (every finalizer removal produces a newresourceVersion).Test coverage
OperatorSettingsdefault and setter.IFusionCacheProviderper strategy.OnEventAsyncbehavioral tests forByResourceVersion: changed version enqueues, unchanged version skips,DeletionTimestamptriggers reconciliation,Deletedevent clears cache.Docs
advanced-configuration.mdx: new "Reconcile Strategy" section explaininggenerationvs.resourceVersion, strategy semantics, use-case guidance, and performance considerations.caching.mdx: updated ResourceWatcher section to document both cache modes and named cache configuration.fixes #803, fixes #826