Skip to content
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

ResourceManager -> ObjectManager #548

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

scothis
Copy link
Contributor

@scothis scothis commented Sep 30, 2024

The ResourceManager type is split into an interface (ObjectManager) and implementing struct (UpdatingObjectManager).

AggregateReconciler, ChildReconciler and ChildSetReconciler are updated to allow specifying an alternative strategy with fallbacks to the previous behavior.

Backwards compatibility is preserved with a number of deprecations, including:

  • ResourceManager is deprecated in favor of ObjectManager for a generic type, or UpdatingObjectManager.
  • AggregateReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize} are deprecated in favor of AggregateReconciler. AggregateObjectManager.
  • ChildReconciler.{Finalizer, HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize, SetResourceManager} are deprecated in favor of ChildReconciler.ChildObjectManager.
  • ChildSetReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize} are deprecated in favor of ChildSetReconciler. ChildObjectManager.

Other strategies can be provided in the future, like replacing Update() calls with server-side apply.

The ResourceManager type is split into an interface (ObjectManager) and
implementing struct (UpdatingObjectManager).

Backwards compatibility is preserved with a number of deprecations,
including:

- `ResourceManager` is deprecated in favor of `ObjectManager` for a
   generic type, or `UpdatingObjectManager`.
- `AggregateReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate,
   Sanitize}` are deprecated in favor of `AggregateReconciler.
   AggregateObjectManager`.
- `ChildReconciler.{Finalizer, HarmonizeImmutableFields,
   MergeBeforeUpdate, Sanitize, SetResourceManager}` are deprecated in
   favor of `ChildReconciler.ChildObjectManager`.
- `ChildSetReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate,
   Sanitize}` are deprecated in favor of `ChildSetReconciler.
   ChildObjectManager`.

Other strategies can be provided in the future, like replacing Update()
calls with server-side apply.

Signed-off-by: Scott Andrews <[email protected]>
@scothis
Copy link
Contributor Author

scothis commented Sep 30, 2024

@mamachanko ready for review. Keeping as draft until I can test with more existing controllers to ensure compatibility.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 35.52632% with 49 lines in your changes missing coverage. Please review.

Project coverage is 59.83%. Comparing base (7c8780b) to head (fe78605).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
reconcilers/objectmanager.go 13.51% 32 Missing ⚠️
reconcilers/child.go 37.50% 10 Missing ⚠️
reconcilers/childset.go 57.14% 6 Missing ⚠️
reconcilers/aggregate.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
- Coverage   60.60%   59.83%   -0.77%     
==========================================
  Files          32       32              
  Lines        2924     2958      +34     
==========================================
- Hits         1772     1770       -2     
- Misses       1057     1094      +37     
+ Partials       95       94       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Scott Andrews <[email protected]>
@scothis scothis marked this pull request as ready for review October 1, 2024 02:51
Signed-off-by: Scott Andrews <[email protected]>
@scothis scothis merged commit 72b6e1c into reconcilerio:main Oct 1, 2024
2 of 4 checks passed
@scothis scothis deleted the object-manager branch October 1, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants