Skip to content
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

client-gen API not generated correctly #185

Closed
jcaamano opened this issue Aug 21, 2024 · 0 comments · Fixed by #186
Closed

client-gen API not generated correctly #185

jcaamano opened this issue Aug 21, 2024 · 0 comments · Fixed by #186
Labels
bug Something isn't working

Comments

@jcaamano
Copy link

It has two issues, related to
kubernetes/code-generator#167
kubernetes/kubernetes#125162

Issue 1

If fails while consuming in downstrean projects due to go tooling not tolerating links on imports:

corev1beta1 "github.com/metallb/frr-k8s/core/v1beta1"

does not work while

corev1beta1 "github.com/metallb/frr-k8s/api/v1beta1"

would work

Fixed by adding

find pkg/client/ -type f -name "*.go" -print0 | xargs -0 sed -i 's|"github.com\/metallb\/frr-k8s\/core\/|"github.com/metallb/frr-k8s/api/|g'

at the end of update-codegen.sh

Issue 2

The generated client uses api instead of apis in the URL path and requests fail.

Fixed by adding

find pkg/client/ -type f -name "*.go" -print0 | xargs -0 sed -i  's|config.APIPath = "/api"|config.APIPath = "/apis"|g'

at the end of update-codegen.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants