Generated code may go to $GOPATH/src
instead of in repo
#249
Labels
kind/bug
Categorizes issue or PR as related to a bug.
$GOPATH/src
instead of in repo
#249
/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
.The text was updated successfully, but these errors were encountered: