-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fakeclient requires types read through unstructured to be registered in the scheme #702
Comments
Okay so actually it seems I should have just read the error message, because I didn't pass in the ListType which happens to work with the non-fake client. However after fixing that, the next error is this:
This issue seems to be rooted in the underlying object tracker used by the fake client. Not sure if and how to fix it. Maybe register Not being able to use |
I think the objectracker needs to use the passed-in scheme, not the kubernetes scheme -- use |
The problem is that it requires the type I am trying to get via an |
oh, yeah, sorry, triaging too fast :-P |
need to dig into objecttracker here probably /help |
@DirectXMan12: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
✨ fix webhook related scaffolding
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
Is there any specific reason to add this check? |
I think now that we changed the interface of |
… Kind=XXX") passed as output Related-to: kubernetes-sigs#702
Hello all, is there a workaround for this at the moment? |
Not to my knowledge. We are happy to take a PR for this that changes the client to work with both UnstructuredList and SomeObjectList if someone is interested. |
I would like to fix this issue |
Yes, I think we have to make in the following way list := &unstructured.UnstructuredList{}
list.SetAPIVersion("apps/v1")
list.SetKind("DeploymentList")
err = cl.List(context.TODO(), list) It make sense to set APIVersion and Kind while making a query with unstructuredlist. Note: We have to setAPIVersion and Kind before making call to |
I confirm, this workaround is good. |
@mittachaitu @xenolog this bug report isn't about the issue you are describing, see the second message. I have retitled it to make that clearer. What you are describing is a different issue, I've opened a fix for that: #1467 |
Hi, is anyone working on this? My team is hitting this issue and we can spend some time trying to fix it. |
@slintes no, feel free to pick it up! |
@alvaroaleman I'm not sure if this is the same issue, but I noticed that if I set the GVK for the Again, not sure if it's related, and not sure if I know an elegant fix. Explicitly handling |
Sounds like a different but potentially related issue. This is about fetching objects through unstructured that are not registered in the Scheme, which implies that client-go is never going to return something other than |
/assign |
Writing a test that uses the fakeClient for code that uses
*unstructured.UnstructuredList
to list something, the test fails with aThe same code works fine when using a non-fake client.
/kind bug
The text was updated successfully, but these errors were encountered: