-
Notifications
You must be signed in to change notification settings - Fork 415
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
go modules support #57
Comments
/cc @sttts |
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. |
Go modules support is now in. /close |
@nikhita: Closing this issue. 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. |
@nikhita is there a specific way to use this with gomodules… noticed sample-controller doesn't work out of the box with it… see kubernetes/sample-controller#47 |
Hi @nikhita, are there any instructions for using the code-generator package when installed as a module? Right now, i've done |
Compare https://github.com/kubernetes/sample-apiserver#when-using-go-111-modules. |
Thanks a lot for referring me to that page, I figured what I was doing wrong. I needed to create a Thanks for the help! |
@parhamdoustdar I tried but it doesn't vendor the
any idea how to trick |
hmm, apparently even if I make that dir available in the vendor dir, the scripts will try to use the one in the GOPATH |
I also don't have the |
Those scripts in the hack dir are not for consumers, but developers of k8s.io/code-generator. You only need those at the root package. |
then I guess I'm calling In all fairness, I have no idea what I'm doing, I inherited a project that was calling:
and it fails with @sttts should I do something differently? |
@mkmik pass your own boilerplate with |
@stts thanks! I didn't realize that template was the responsibility of the user; it seems obvious in retrospect. would it make sense to just make the |
We intentionally default it that way, so that people won't have to use the
Instead of making this mandatory, I think we could improve the error message and documentation around this. As a side-note, we intend to make code-generation more module-friendly, so this problem should go away then - kubernetes/publishing-bot#196 (comment). |
@nikhita, thanks; yeah using module aware functions to locate the default file would do the trick. |
184: Ensure k8s.io/code-generator is vendored r=mkmik a=mkmik and implements a hack until I figure out how to use code-generator properly (or an upstream issue is fixed), see kubernetes/code-generator#57 . Closes #153 Co-authored-by: Marko Mikulicic <mkm@bitnami.com>
@marccarre I noticed that you haven't had an answer on this. What did you settle on? |
@alexellis, sorry, this was almost two years ago and I'm afraid I can no longer remember. 😔 |
The generators insist on putting generated code into the GOPATH, rather than relative to the local directory the tool is running in.
For the simplest use case of generating code for a single controller, it seems like it should be possible to support building/generating outsisde of a GOPATH, using go modules. It's not clear to me what other use cases this tool supports, and/or if using it outside of GOPATH makes sense (hopefully it can, as I think GOPATH's long term support is in question)
The text was updated successfully, but these errors were encountered: