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
Resource factories #160
Comments
cc @edwardecook @jhvhs @shashwathi @gmrodgers @Samze who have contributed to this package |
Steps 1, 2 and 3 are now implemented. I ended up going with Users will need to update their test suite types from Leaving this issue open until we remove the factory types in a later release |
This completes the removal of the factory types that were deprecated in v0.4.0. dies.dev dies are now used as a replacement. Refs #160 Signed-off-by: Scott Andrews <andrewssc@vmware.com>
The factories were removed in #175 |
The resource factories used by reconciler test suites were created as a way to reduce the boiler plate for resources under test. These factories served their purpose, but suffer from a couple flaws:
I'd like to deprecate the existing factories in favor of encouraging users to define resources how they see fit. For example, https://github.com/scothis/dies follows in the spirit of reconciler runtime's factories while seeking to provide support for all common built-it k8s resources, and provides tools for generating wrappers for new types.
This migration should be broken down into a series of steps:
rtesting.Factory
interface to useruntime.Object
(orclient.Object
if needed)runtime.Object
to make them compatibleInside the reconciler runtime test harnesses, any bare use of a
runtime.Object
resource should always call.DeepCopyObject()
to unwrap a factory type (if any). We largely already do this to avoid accidental mutation between test cases and to unwrap the existing factory types.The immediate impact to most users would be that they'd need to update the test cases from defending
[]rtesting.Factory
to[]runtime.Object
. Creators of custom type would need update them to implementruntime.Object
or call.CreateObject()
on each factory to convert the factory type to aruntime.Object
.The longer impact is that consumers of the factory types would either need to fork the types into their own repo, or convert to a different factory type (like https://github.com/scothis/dies)
The text was updated successfully, but these errors were encountered: