-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Cannot use client-go's fake client with Gateway API objects #116253
Comments
/sig api-machinery |
/sig network |
Hey @pmalek, you also need to find a way to add the Gateway API types to the scheme first, something like this: Feel free to follow up on Gateway API Slack if you're still running into issues, lots of people there that would have dealt with this. /close |
@robscott: Closing this issue. 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. |
Actually, looks like I misread the issue, would still recommend chatting in #sig-network-gateway-api on Slack, but reopening because I don't think my suggested solution was helpful. /reopen |
@robscott: Reopened this issue. 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. |
/assign @shaneutt |
For clarity, the request here is to export fake's schema so that other objects can be added to it, or for the ability to pass a schema in for fakes to use. |
Yes. Either that or explain/document a way to do it differently. |
/triage accepted |
Yeah, I don't think there's going to be any other options. /assign @apelisse |
As we discussed in slack this is not networking specific, thanks @lavalamp! 👍 /remove-sig network |
is there any workaround or a different approach maybe ? |
Unfortunately not for the
So you can get a working client but unfortunately due to kubernetes/client-go#1082 you won't get it work work:
This is due to https://github.com/kubernetes/client-go/blob/84a6fe7e4032ae1b8bc03b5208e771c5f7103549/testing/fixture.go#L292 holding |
I just bumped into this. Is it currently impossible to use a fake client with Gateway resources? |
What happened?
I'm trying to work with Gateway API fake objects by doing the following:
but that doesn't work, i.e. I get this:
What would work is
with the twist that the
Scheme
inclient-go
'sfake
package gets exported.I was suggested to create an issue in this repo as
client-go
might get overlooked and not triaged.Related #sig-api-machinery thread: https://kubernetes.slack.com/archives/C0EG7JC6T/p1676125039126589
What did you expect to happen?
Fake object to work with client-go
How can we reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
No response
Kubernetes version
N/A
Cloud provider
N/A
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response
The text was updated successfully, but these errors were encountered: