Closed raonadeem closed 3 years ago
Hi @raonadeem,
The version 2.3.1
requires the go version 1.13. Also, it might be related to your local configuration as well. So, if you would like to use go version 1.15 I'd like to recommend you use the master branch instead of the released version. In this way, could you please;
And then, if you still facing issues could you please provide the output of go env
for we are able to check and see if we can find something that is missing to help you with?
We are looking for your reply.
Hi @camilamacedo86 ,
The issue is resolved if I initialize the go mod;
go mod init 'modulename'
But, I'm working in GOPATH and don't know why it needs go mod init.
pwd /usr/local/go/src/nadeem
Following are my go env;
go env
GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/root/.cache/go-build" GOENV="/root/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/usr/local/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/usr/local/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/usr/local/go/src/nadeem/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build231577266=/tmp/go-build -gno-record-gcc-switches"
So, you are creating the project outside of the GOPATH. Am right? If yes, you need to use the --repo flag to describe the module or run go mod init before. See: https://book.kubebuilder.io/quick-start.html#not-in-gopath .It is described in the docs. So, shows fine we close this one. Please, let me know if you see any reason for we keep this one open.
I'm In GOPATH as here;
pwd /usr/local/go/src/nadeem
mkdir $GOPATH/src/nadeem cd $GOPATH/src/nadeem kubebuilder init --domain my.domain
And getting the same error as above.
Hi @raonadeem,
It shows to be related to the go version used. See that for 2.3.1 it requires to go 1.13. In this way, shows fine we close this one. However, please feel free to ping us to re-open this one if you need.
I'm trying to initialize the Kubebuilder project with the following commands and getting the errors;
kubebuilder init --domain example.com --license apache2 --owner "The Kubernetes authors"
Following are my package versions;
go version go1.15.3 linux/amd64
Version: version.Version{KubeBuilderVersion:"2.3.1", KubernetesVendor:"1.16.4", GitCommit:"8b53abeb4280186e494b726edf8f54ca7aa64a49", BuildDate:"2020-03-26T16:42:00Z", GoOs:"unknown", GoArch:"unknown"}
{Version:kustomize/v3.8.6 GitCommit:c1747439cd8bc956028ad483cdb30d9273c18b24 BuildDate:2020-10-29T23:07:50Z GoOs:linux GoArch:amd64}