-
Notifications
You must be signed in to change notification settings - Fork 18
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
Enable testing SubReconcilers with duck typed resources #454
Conversation
The Resource is now converted to an unstructured before being set as a given on the fake client. Previously it would panic because the duck was not registered on the scheme (which it should not be). Signed-off-by: Scott Andrews <andrewssc@vmware.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #454 +/- ##
==========================================
- Coverage 60.68% 60.54% -0.15%
==========================================
Files 26 26
Lines 2526 2532 +6
==========================================
Hits 1533 1533
- Misses 904 910 +6
Partials 89 89
☔ View full report in Codecov by Sentry. |
testName := "test-resource" | ||
|
||
scheme := runtime.NewScheme() | ||
// _ = resources.AddToScheme(scheme) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is this to convey that a duck need not be registered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, it's fine for these types to be registered, but having them not registered proves they are not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working perfectly for my use-case . Thankyou!
The Resource is now converted to an unstructured before being set as a given on the fake client. Previously it would panic because the duck was not registered on the scheme (which it should not be).