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

Generated code may go to $GOPATH/src instead of in repo #249

Closed
stmcginnis opened this issue Mar 24, 2021 · 0 comments · Fixed by #250
Closed

Generated code may go to $GOPATH/src instead of in repo #249

stmcginnis opened this issue Mar 24, 2021 · 0 comments · Fixed by #250
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@stmcginnis
Copy link
Contributor

/kind bug

What steps did you take and what happened:

Found in kubernetes-sigs/cluster-api#4185

We use conversion-gen to generate some of the code. This command has an optional argument of --output-base that controls where the generated files are placed.

The default for this arg can vary. If GOPATH is set, then it will place files under $GOPATH/src. But if not set, it defaults to ./, which is what we want to have the generated files within the repo.

The dependency on an environment variable is non-obvious and can cause stale files to be used if the user doesn't know about it. There also appears to be a difference whether running with the repo cloned within $GOPATH/src or elsehwere.

What did you expect to happen:

Files generated/over-written within the repo. In environment with GOPATH set, files were generated under $GOPATH/src/api.

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants