-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[post-1.20] Fake Dynamic Client requires scheme registration with listType, breaks duck typing. #949
Comments
A few points
I'm open to allowing this to be specified via function if you like, but the data needs to be returned by the fake client to have parity with the real client, so I don't see an effective way to simply stop requiring this mapping. |
Do you have a way to do this at runtime for the fake dynamic client? We are getting panics with empty listTypes? |
I'm open to a PR to make the dynamic client take a mapping function instead of a static mapping. But we have to return the objectmeta on the list values returned from the fake dynamic client. |
The list type comes from calls like this when registering schema?
Perhaps I just need help understanding where the fake dynamic client is assuming the listType value comes from. |
oh, I see. There is a new method I should be using, the old method will not work with List.
|
OK, followup, there is code in the original
/close |
we in Knative attempted to update to k8s client-go 1.20 and found that the fake dynamic client no longer works with duck typing because of this addition: 20c034c#diff-8ba8eeecc835702a1f7fbb6d06b268cb17453f82c5ef5c8294f25fcdf0f53dacR316-R318 @deads2k I will keep looking at the impl, but I fail to see how the dynamic client is useful if scheme registration is required, it means you can not use the dynamic client for unknown types?
it does not look like ListType is even required to list in the dynamic client:
client-go/dynamic/simple.go
Lines 253 to 275 in f6ce18a
unknown list types should be
*unstructured.UnstructuredList
and I think the change to fake dynamic client is an error/bug.It does not make sense to require scheme registration with the dynamic client, the whole point is it is dynamic right?
Knative issue: knative/eventing#5185
The text was updated successfully, but these errors were encountered: