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

Makefile: make generate-go-openapi is broken if repository is not in GOPATH #6526

Closed
chrischdi opened this issue May 17, 2022 · 7 comments · Fixed by #6815 or #6820
Closed

Makefile: make generate-go-openapi is broken if repository is not in GOPATH #6526

chrischdi opened this issue May 17, 2022 · 7 comments · Fixed by #6815 or #6820
Labels
area/runtime-sdk Issues or PRs related to Runtime SDK kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@chrischdi
Copy link
Member

What steps did you take and what happened:

This did results in

  • unexpected content for the zz_generated.openapi.go files
  • as well as having them at a wrong place.

What did you expect to happen:

In this case no changes for the zz_generated.openapi.go files.

Anything else you would like to add:

The reason for that is the dependabot github action here does not run make generate inside the GOPATH.

This results in make generate-go-openapi which gets transitively executed to also not run inside the GOPATH.

Issue was introduced in #6462 and only affects the generation of openapi code.

For kube-openapi this is still an unresolved issue kubernetes/kube-openapi#233

They did workaround this issue themselves in kubernetes/kube-openapi#225

[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api version:
  • Minikube/KIND version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 17, 2022
@chrischdi
Copy link
Member Author

For now we could fix the dependabot GH action by either:

  • removing make generate which may be okay because we restrict dependabot to only bump golangci-lint and github.com/coredns/corefile-migration which both should not affect any generated code.
  • adjusting the dependabot GH action to checkout cluster-api into GOPATH

On long-term we could take a look at kubernetes/kube-openapi#233

@fabriziopandini
Copy link
Member

/area runtime-sdk
/milestone v1.2

@k8s-ci-robot k8s-ci-robot added this to the v1.2 milestone May 22, 2022
@k8s-ci-robot k8s-ci-robot added the area/runtime-sdk Issues or PRs related to Runtime SDK label May 22, 2022
@fabriziopandini
Copy link
Member

I'm personally +1 to adjusting the dependabot GH action to checkout cluster-api into GOPATH because this will avoid similar problems in the future, but I will defer this to @sbueringer and @chrischdi

@sbueringer
Copy link
Member

To fix dependabot I would favor checking out in GOPATH over dropping make generate.

Overall it would be nice to get the root cause fixed, given that in addition to the problems that some have with generate conversion we now have a second target which forces users to checkout CAPI in GOPATH.

@sbueringer
Copy link
Member

sbueringer commented Jun 7, 2022

fyi. I'll implement a workaround for the action here: #6607

  • But that should be reverted if the upstream openapi-gen is fixed / or we find a way to run it outside of the GOPATH.

We should definitely fix it in general though as already folks regularly hit this issue locally.

@sbueringer
Copy link
Member

sbueringer commented Jul 5, 2022

/reopen

Let's drop the workaround from the dependabot

@k8s-ci-robot k8s-ci-robot reopened this Jul 5, 2022
@k8s-ci-robot
Copy link
Contributor

@sbueringer: Reopened this issue.

In response to this:

/reopen

Let's drop the workaround from the golangci-lint action

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime-sdk Issues or PRs related to Runtime SDK kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
4 participants