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

Having issue when try to run 'make install' in version 2.3.1 #1619

Closed
BlueShells opened this issue Jul 30, 2020 · 2 comments
Closed

Having issue when try to run 'make install' in version 2.3.1 #1619

BlueShells opened this issue Jul 30, 2020 · 2 comments
Assignees

Comments

@BlueShells
Copy link

BlueShells commented Jul 30, 2020

Hi , I try to follow the https://book.kubebuilder.io/cronjob-tutorial/running.html to create the cronjob operator

but , when I try to install the operator by running command "make install" ,I got following error :

/Users/jeremyzhang/go-workspace//bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
main.go:29:2: package cronjob/api/v1 is not in GOROOT (/usr/local/go/src/cronjob/api/v1)
Error: not all generators ran successfully
run `controller-gen crd:trivialVersions=true rbac:roleName=manager-role webhook paths=./... output:crd:artifacts:config=config/crd/bases -w` to see all available markers, or `controller-gen crd:trivialVersions=true rbac:roleName=manager-role webhook paths=./... output:crd:artifacts:config=config/crd/bases -h` for usage

I have to put my project under /usr/local/go/src/cronjob ?

my project path is :
/Users/jeremyzhang/go-workspace/src/cronjob

here is my env:
export GOPATH=/Users/jeremyzhang/go-workspace/ # don't forget to change your path correctly! export GOROOT=/usr/local/go/ export PATH=$PATH:$GOPATH/bin export PATH=$PATH:$GOROOT/bin export PATH=$PATH:/usr/local/kubebuilder/bin

and here is the version :

kubebuilder version Version: version.Version{KubeBuilderVersion:"2.3.1", KubernetesVendor:"1.16.4", GitCommit:"8b53abeb4280186e494b726edf8f54ca7aa64a49", BuildDate:"2020-03-26T16:42:00Z", GoOs:"unknown", GoArch:"unknown"}

go version:
go version go version go1.14.5 darwin/amd64

@camilamacedo86
Copy link
Member

Hi @BlueShells,

When you create the project, if you are working with it outside of the GOPATH you need to provide the --repo. The repo will be used to gen the go modules. See the information in : https://book.kubebuilder.io/quick-start.html#not-in-gopath as the link for the Go doc.

Shows that when you run the makefile target the controller-tools is unable to generate the code because the go modules path is not accurate.

Also, note that the project officially only supports 1.13 go version and not 1.14.

I am closing this one since shows that all required info about how you can work with go modules are provided above. However, feel free to re-open it if you see that still required.

/assign @camilamacedo86
/close

@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: Closing this issue.

In response to this:

Hi @BlueShells,

When you create the project, if you are working with it outside of the GOPATH you need to provide the --repo. The repo will be used to gen the go modules. See the information in : https://book.kubebuilder.io/quick-start.html#not-in-gopath as the link for the Go doc.

Shows that when you run the makefile target the controller-tools is unable to generate the code because the go modules path is not accurate.

Also, note that the project officially only supports 1.13 go version and not 1.14.

I am closing this one since shows that all required info about how you can work with go modules are provided above. However, feel free to re-open it if you see that still required.

/assign @camilamacedo86
/close

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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants