Releases: vmware-labs/reconciler-runtime
Release v0.6.0
Breaking Changes
No breaking changes in this release.
Type renames (the previous names are deprecated, but still functional):
reconcilers.ParentReconciler
->reconcilers.ResourceReconciler
reconcilers.CastParent
->reconcilers.CastResource
reconcilers.RetrieveCastParentType
->reconcilers.RetrieveResourceType
reconcilers.RetrieveParentConfig
->reconcilers.RetrieveOriginalConfig
reconcilers.RetrieveParentType
->reconcilers.RetrieveOriginalResourceType
reconcilers.StashCastParentType
->reconcilers.StashResourceType
reconcilers.StashParentConfig
->reconcilers.StashOriginalConfig
reconcilers.StashParentType
->reconcilers.StashOriginalResourceType
Highlights
- AggregateReconciler defines a specific resource (#241)
- Define ResourceManager to create/update/delete resources (#244)
- Support testing with Unstructured (#240)
- Allow custom Setup method on root reconcilers (#243)
What's Changed
- Avoid "parent" unless in the context of a child by @scothis in #238
- Bump sigs.k8s.io/controller-runtime from 0.12.0 to 0.12.1 by @dependabot in #239
- Support testing with Unstructured by @scothis in #240
- AggregateReconciler by @scothis in #241
- Allow custom Setup method on root reconcilers by @scothis in #243
- Define ResourceManager to create/update/delete resources by @scothis in #244
- Use favor kind for typeName when available by @scothis in #245
- Bump k8s.io/client-go from 0.24.0 to 0.24.1 by @dependabot in #247
- Bump sigs.k8s.io/controller-tools from 0.8.0 to 0.9.0 in /hack by @dependabot in #242
Full Changelog: v0.5.0...v0.6.0
Release v0.5.0
Breaking Changes
-
We depend on Kubernetes 1.24 and controller-runtime 0.12 each with their own breaking changes.
-
Types deprecated in reconciler-runtime 0.4 have been removed. Including:
- The github.com/vmware-labs/reconciler-runtime/testing/factories package. Spiritually equivalent and much more complete options are available via libraries like dies.dev.
rtesting.Factory
rtesting.Wrapper
-
Many reconcilers no longer directly accept a Config, it’s passed in the context and retrieved with RetrieveConfig or RetrieveConfigOrDie. ParentReconciler still requires a Config.
If you see a compiler error
unknown field Config in struct literal
it's safe to delete the field. -
Config.Log is deprecated and will print a warning on first use. Instead use logr to fetch a logger from the context.
log := logr.FromContextOrDiscard(ctx)
-
In SubReconcilerTestSuite the parent resource is automatically a given, added the resource explicitly will err.
Highlights
- Finalizer support on the ChildReconciler and new WithFinalizer sub-reconcilers. (#207 #228)
- The
Config
is now passed via the context and retrieved withRetrieveConfig
orRetrieveConfigOrDie
. The WithConfig sub-reconciler can inject a custom config for dependent reconciler than the parent reconciler. TheLog
field on the Config is deprecated, it can be fetched from the context usingFromContextOrDiscard
(#208 #209 #220) - All reconciler are now named, the name is added to the logr and some errors (#230 #231)
- ChildReconciler resources are no longer constrained to the same namespace as the parent. Use of a Finalizer is strongly recommended, minimally set
SkipOwnerReference
totrue
and define an appropriateOurChild
method. (#221 #229 #235 #236) - Client
Patch
andDeleteAllOf
operation are supposed on tests (#202) TrackAndGet
to automatically track the resource being retrieved for the parent (#232)- Clarify expectations around status, warning are logged during setup if the shape means that a feature of the ParentReconciler will not be available (#233)
- Numerous improvements to the README (#198 #199 #219)
What's Changed
- Move TestResource into an internal package by @scothis in #174
- Switch from Factories to Dies by @scothis in #175
- Bump sigs.k8s.io/controller-tools from 0.7.0 to 0.8.0 in /hack by @dependabot in #176
- Bump k8s.io/client-go from 0.23.1 to 0.23.2 by @dependabot in #180
- Bump github.com/google/go-cmp from 0.5.6 to 0.5.7 by @dependabot in #179
- Bump k8s.io/client-go from 0.23.2 to 0.23.3 by @dependabot in #183
- Bump dies.dev/diegen from 0.2.0 to 0.3.0 in /hack by @dependabot in #184
- Bump dies.dev from 0.2.0 to 0.3.0 by @dependabot in #185
- Bump sigs.k8s.io/controller-runtime from 0.11.0 to 0.11.1 by @dependabot in #187
- Bump k8s.io/client-go from 0.23.3 to 0.23.4 by @dependabot in #191
- Bump actions/checkout from 2.4.0 to 3 by @dependabot in #193
- Bump k8s.io/client-go from 0.23.4 to 0.23.5 by @dependabot in #194
- Describe the status contract by @mamachanko in #198
- Include "Status" in the README's ToC by @mamachanko in #199
- Bump sigs.k8s.io/controller-runtime from 0.11.1 to 0.11.2 by @dependabot in #201
- Bump actions/setup-go from 2 to 3 by @dependabot in #205
- Support client patch and delete collection requests for tests by @scothis in #202
- Add parent resource as a given by @scothis in #206
- Move logger into context by @scothis in #208
- Bump k8s.io/client-go from 0.23.5 to 0.23.6 by @dependabot in #211
- Move config into context by @scothis in #209
- Avoid accidental mutations during sanitize by @scothis in #213
- Bump github.com/google/go-cmp from 0.5.7 to 0.5.8 by @dependabot in #218
- Improve config.Log deprecation help by @mamachanko in #215
- Ignore JetBrains IDE files by @mamachanko in #214
- Add RBAC recommendations for controllers by @scothis in #219
- Allow OurChild to make decisions with the parent and child objects by @scothis in #221
- Bump dies.dev from 0.3.0 to 0.4.0 by @dependabot in #223
- Bump dies.dev/diegen from 0.3.0 to 0.4.0 in /hack by @dependabot in #222
- Avoid a race condition while initializing a ChildReconciler by @scothis in #227
- Allow WithConfig to create dynamic configs by @scothis in #220
- Finalizers by @scothis in #207
- Add missing parent to invocation of
ChildReconciler.OurChild
by @mamachanko in #229 - WithFinalizer by @scothis in #228
- Normalize reconciler name by @scothis in #231
- Include reconciler name in validation errors by @mamachanko in #230
- TrackAndGet by @scothis in #232
- Bump sigs.k8s.io/controller-runtime from 0.11.2 to 0.12.0 by @dependabot in https://githu...
Release v0.4.0
Breaking Changes
There are a number of small breaking changes in this release. Many of them are caused by upstream changes that cascade into this release. Please review the controller-runtime and Kubernetes release notes in addition to the below.
The github.com/vmware-labs/reconciler-runtime/testing/factories package is deprecated and will be removed in a future release. Spiritually equivalent and much more complete options are available via libraries like dies.dev.
rtesting.Factory
is deprecated and will be removed in the future. Existing usage has changed to client.Object
, each of these uses will call .DeepCopyObject()
before using the content. This method can be used to create a factory equivalent. dies.dev and the now deprecated factories use this pattern allowing them to be dropped into test suites along with vanilla k8s objects without needing a wrapper.
apis.Condition
and related objects were removed in favor of metav1.Condition
. While this is nearly a drop in replacement there are differences. The reason
field is now required, the severity
field does not exist. The ConditionSet
s and ConditionManger
remain, and are updated to use metav1.Condition
.
What's Changed
- [BREAKING] Bump k8s.io/* to 0.23.1
- [BREAKING] Bump sigs.k8s.io/controller-runtime to 0.11.0
- [BREAKING] Bump github.com/go-logr/logr from 0.4.0 to 1.2.0
- [BREAKING] Bump minimum Golang version to 1.17
- [BREAKING] Replace custom conditions with metav1.Condition by @scothis in #172
- [BREAKING] Deprecate resource factories by @scothis in #162
- [FEATURE] Add ClusterRole and ClusterRoleBinding factories by @jhvhs in #118
- [FEATURE] Add image pull secrets method to factory by @edwardecook in #137
- [FEATURE] Expose more of the testing types by @scothis in #133
- [BUG] Ignore ResourceVersion in tests with stashed resources by @scothis in #119
New Contributors
- @jhvhs made their first contribution in #118
- @edwardecook made their first contribution in #137
Full Changelog: v0.3.0...v0.4.0
Release v0.3.0
Thanks to @Samze, @gmrodgers and @shashwathi for contributing to this release
Change log:
- Update to controller-runtime 0.8 (#94)
- Update Kubernetes APIs to 0.20 (#97)
- Allow multiple child resource of the same kind for a parent resource (#77)
- Reflect mutations from cast parent back to parent (#59)
- Fix SyncReconciler passing reflect.Type as key to logger (#80)
- Miscellaneous enhancement to object factories (#80, #81, #82)
- Deprecate Test method for table tests (#105)
Breaking changes:
- Drop ChildReconciler#IndexField (#68)
There is no required action other than to remove the field from child reconcilers
Release v0.2.0
Changelog:
- Compatibility for k8s 1.18 and 1.19 apis and controller-runtime 0.6 (#14)
- Cast parent resource type (#51)
- Define reconciler Sequence as a SubReconciler (#50)
- Status only child reconciliation (#49)
- Add NewConfig helper to streamline manager mains (#43)
- Validate sub reconcilers on setup (#42)
- Gracefully handle child resources mutated by admission controllers
- Adopt Contributor Covenant version 2.0 (#46)
Breaking changes:
While these changes look like a lot, they are each relatively straight forward to adopt. In many cases, the go compiler will provide meaningful error messages. In other cases, the new runtime type validation will provide a meaningful error message. Many of these breakages were necessitated by upstream breaking changes in Kubernetes 1.18 and controller-runtime 0.6.
reconcilers.ParentReconciler#SetupWithManager(mgr ctrl.Manager) error
->reconcilers.ParentReconciler#SetupWithManager(ctx context.Context, mgr ctrl.Manager) error
(#14)reconcilers.SubReconciler#SetupWithManager(mgr ctrl.Manager, bldr *builder.Builder) error
->reconcilers.SubReconciler#SetupWithManager(ctx context.Context, mgr ctrl.Manager, bldr *builder.Builder) error
(#14)reconcilers.SyncReconciler#Setup
:func(mgr ctrl.Manager, bldr *builder.Builder) error
->func(ctx context.Context, mgr ctrl.Manager, bldr *builder.Builder) error
(#14)reconcilers.ChildReconciler#Setup
:func(mgr ctrl.Manager, bldr *builder.Builder) error
->func(ctx context.Context, mgr ctrl.Manager, bldr *builder.Builder) error
(#14)ParentReconciler#SubReconcilers []SubReconciler
is nowParentReconciler#Reconciler SubReconciler
. Usereconcilers.Sequence
for a slice of SubReconcilers. (#50)reconcilers.ChildReconciler#ParentType
is removed, the value is now passed from the the ParentReconciler. ChildReconciler and SyncReconcilers may use a struct or compatible interface to represent the parent resource. (#42)reconcilers.ChildReconciler#DesiredChild
must accept a context as it's first argument. The context is used to pass state between sub reconcilers, always including will make it easier to retrieve stashed state. (#42)reconcilers.IndexControllersOfType(mgr ctrl.Manager, field string, owner, ownee runtime.Object, scheme *runtime.Scheme) error
->reconcilers.IndexControllersOfType(ctx context.Context, mgr ctrl.Manager, field string, owner, ownee runtime.Object, scheme *runtime.Scheme) error
(#14)