Skip to content

v0.23.0

Choose a tag to compare

@scothis scothis released this 19 Feb 19:57
· 89 commits to main since this release
d4697d5

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)
			}
		}
	}

full source

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

  • ResourceManager was deprecated in v0.22.0 and is removed in favor of ObjectManager for a generic type, or UpdatingObjectManager.

  • AggregateReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize} were deprecated in v0.22.0 and are removed in favor of AggregateReconciler.AggregateObjectManager.

  • ChildReconciler.{Finalizer, HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize, SetResourceManager} were deprecated in v0.22.0 and are removed in favor of ChildReconciler.ChildObjectManager.

  • ChildSetReconciler.{HarmonizeImmutableFields, MergeBeforeUpdate, Sanitize} were deprecated in v0.22.0 and are removed in favor of ChildSetReconciler.ChildObjectManager.

  • AdmissionWebhookAdapter#Build is newly deprecated in favor of AdmissionWebhookAdapter#BuildWithContext.

  • AdmissionWebhookTestSuite#Run, AdmissionWebhookTests#Run, and AdmissionWebhookTestCase#Run are newly deprecated in favor of #RunWithContext.

What's Changed

New Contributors

Full Changelog: v0.22.0...v0.23.0