-
Notifications
You must be signed in to change notification settings - Fork 428
Generator only works if k8s.io/apimachinery is in the $GOPATH #21
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
Comments
I worked out the issue - this doesn't work unless k8s.io/apimachinery is in the GOPATH, if it is just vendored, then deepcopy can't find it. At the very least, this needs to be documented somewhere, but it would be great if the vendored version worked as well. Changed title to represent the actual issue. |
+1 for fix or documentation. I encounter the same issue and only find the solution mentioned before by Google. |
@markmandel @jinghzhu do you have a small example repo where this can be seen? |
@sttts you can copy the above section into a |
The cause for the issue described above is that the generators are not called from the sample-apiserver directory. Only then gengo (the Golang parsing library below) can pick up the vendor/ directory properly. The following Dockerfile passes the deepcopy-gen call, but fails at client-gen (compare kubernetes/kubernetes#57143 for a fix).
|
PR welcome to improve our codegen shell scripts to cope with out-of-dir invocations. |
Also note that the package is called |
I am facing the same issue |
@rahulkrishnanfs compare my comment #21 (comment). You have to call the generator script with a relative CODEGEN_PKG. Does it help? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
If running locally/on CircleCI, the code generators must be run from within the Velero directory in order to properly find all the types. See kubernetes/code-generator#21 Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
If running locally/on CircleCI, the code generators must be run from within the Velero directory in order to properly find all the types. See kubernetes/code-generator#21 Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
/reopen See kubernetes/kubernetes#79149 (comment) Either the documentation should inform users to prepare their GOPATHS with the necessary dependencies or the code-generator be improved so it no longer has this requirement. |
@mattysweeps: You can't reopen an issue/PR unless you authored it or you are a collaborator. 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. |
@markmandel please consider reopening this issue. I see no evidence that it has been solved, and users are still running into issues. Thank you. |
Whenever I attempt to run
update-codegen.sh
, but constantly get the below stacktrace.I created a simple test case using a Dockerfile below, using the sample-controller example, which replicates the problem.
Help?
The text was updated successfully, but these errors were encountered: