v0.23.0
Highlights
Nested Reconciler validation
Reconcilers/SubReconcilers/AdmissionWebhookAdapters are now validated, with the validation extending into nested SubReconcilers for tests. This will provide meaningful fast failures for test cases that embed invalid reconcilers.
In order to participate custom types need to implement validation.Validator interface. Calling into the Validate() method on nested types should be guarded by checking validation.IsRecursive.
if validation.IsRecursive(ctx) {
if v, ok := r.Reconciler.(validation.Validator); ok {
if err := v.Validate(ctx); err != nil {
return fmt.Errorf("Advice %q must have a valid Reconciler: %w", r.Name, err)
}
}
}ChildReconciler/ChildSetReconciler error handling
The ChildReconciler can now define the set of error conditions that will be passed to ChildReconciler#ReflectChildStatusOnParent at ChildReconciler#ReflectedChildErrorReasons. By default the set of passed errors are:
Custom diffing for types in tests
ExpectConfig and test cases that embed it are able to define a custom Differ that is used to compare the side effects of the test expected and actual values. By default this is implemented using go-cmp. Users who wish to use a different diff implementation, or provide custom cmp.Options may implement the Differ interface and assign it to the particular config or test case.
Breaking Changes and Deprecations
-
ResourceManagerwas deprecated in v0.22.0 and is removed in favor ofObjectManagerfor a generic type, orUpdatingObjectManager. -
AggregateReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize}were deprecated in v0.22.0 and are removed in favor ofAggregateReconciler.AggregateObjectManager. -
ChildReconciler.{Finalizer, HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize, SetResourceManager}were deprecated in v0.22.0 and are removed in favor ofChildReconciler.ChildObjectManager. -
ChildSetReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize}were deprecated in v0.22.0 and are removed in favor ofChildSetReconciler.ChildObjectManager. -
AdmissionWebhookAdapter#Buildis newly deprecated in favor ofAdmissionWebhookAdapter#BuildWithContext. -
AdmissionWebhookTestSuite#Run,AdmissionWebhookTests#Run, andAdmissionWebhookTestCase#Runare newly deprecated in favor of#RunWithContext.
What's Changed
- Drop deprecated ResourceManager APIs by @scothis in #549
- Bump golang.org/x/net from 0.29.0 to 0.30.0 by @dependabot in #551
- Bump sigs.k8s.io/controller-tools from 0.16.3 to 0.16.4 in /hack by @dependabot in #552
- Bump github.com/fatih/color from 1.17.0 to 1.18.0 by @dependabot in #553
- Bump the kubernetes group with 3 updates by @dependabot in #554
- Bump sigs.k8s.io/controller-runtime from 0.19.0 to 0.19.1 by @dependabot in #555
- Bump sigs.k8s.io/controller-tools from 0.16.4 to 0.16.5 in /hack by @dependabot in #556
- Bump golang.org/x/net from 0.30.0 to 0.31.0 by @dependabot in #558
- Bump codecov/codecov-action from 4 to 5 by @dependabot in #559
- Bump sigs.k8s.io/controller-runtime from 0.19.1 to 0.19.2 by @dependabot in #561
- Bump the kubernetes group with 3 updates by @dependabot in #560
- Bump sigs.k8s.io/controller-runtime from 0.19.2 to 0.19.3 by @dependabot in #562
- Bump golang.org/x/net from 0.31.0 to 0.32.0 by @dependabot in #563
- Bump the kubernetes group with 3 updates by @dependabot in #564
- Bump the kubernetes group with 4 updates by @dependabot in #565
- Bump reconciler.io/dies to 0.15.0 by @scothis in #566
- Bump golang.org/x/net from 0.32.0 to 0.33.0 by @dependabot in #567
- Bump sigs.k8s.io/controller-tools from 0.16.5 to 0.17.0 in /hack by @dependabot in #568
- Track colliding child resources that are not owned by @scothis in #569
- Bump golang.org/x/net from 0.33.0 to 0.34.0 by @dependabot in #570
- Bump sigs.k8s.io/controller-runtime from 0.19.3 to 0.19.4 by @dependabot in #571
- Bump sigs.k8s.io/controller-tools from 0.17.0 to 0.17.1 in /hack by @dependabot in #572
- Bump the kubernetes group with 3 updates by @dependabot in #573
- fix: stop using deprecated webhook.Validator and webhook.Defaulter by @mamachanko in #575
- Bump sigs.k8s.io/controller-runtime from 0.19.4 to 0.20.0 by @dependabot in #574
- Bump sigs.k8s.io/controller-runtime from 0.20.0 to 0.20.1 by @dependabot in #576
- Bump github.com/evanphx/json-patch/v5 from 5.9.0 to 5.9.10 by @dependabot in #577
- Allow ChildReconciler to choose which errors to reflect by @scothis in #579
- Bump github.com/evanphx/json-patch/v5 from 5.9.10 to 5.9.11 by @dependabot in #581
- fix: minor adjustments in README by @bartoszmajsak in #582
- Export reconciler Validate method by @scothis in #580
- Add flag for allowing status updates even when resource is being deleted by @andrew-su in #586
- Update link to AdmissionWebhookAdapter example source by @mamachanko in #587
- Polish by @mamachanko in #592
- Validate nested reconcilers by @mamachanko in #588
- Bump golang.org/x/net from 0.34.0 to 0.35.0 by @dependabot in #593
- Bump sigs.k8s.io/controller-tools from 0.17.1 to 0.17.2 in /hack by @dependabot in #594
- Allow rtesting to use custom diff func by @scothis in #590
- Bump the kubernetes group with 3 updates by @dependabot in #595
- Bump sigs.k8s.io/controller-runtime from 0.20.1 to 0.20.2 by @dependabot in #596
- Validate AdmissionWebhookAdapter by @scothis in #597
New Contributors
- @bartoszmajsak made their first contribution in #582
- @andrew-su made their first contribution in #586
Full Changelog: v0.22.0...v0.23.0