This repository was archived by the owner on Aug 28, 2024. It is now read-only.
Enable testing SubReconcilers with duck typed resources#454
Merged
scothis merged 1 commit intovmware-labs:mainfrom Nov 6, 2023
scothis:sub-duck
Merged
Enable testing SubReconcilers with duck typed resources#454scothis merged 1 commit intovmware-labs:mainfrom scothis:sub-duck
scothis merged 1 commit intovmware-labs:mainfrom
scothis:sub-duck
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. |
mamachanko
approved these changes
Nov 6, 2023
mamachanko
approved these changes
Nov 6, 2023
| testName := "test-resource" | ||
|
|
||
| scheme := runtime.NewScheme() | ||
| // _ = resources.AddToScheme(scheme) |
Collaborator
There was a problem hiding this comment.
question: Is this to convey that a duck need not be registered?
Contributor
Author
There was a problem hiding this comment.
yea, it's fine for these types to be registered, but having them not registered proves they are not needed.
squeedee
approved these changes
Nov 6, 2023
Contributor
squeedee
left a comment
There was a problem hiding this comment.
Working perfectly for my use-case . Thankyou!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).