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

Quickstart/go: "create api" fails with "package github.com/go-logr/logr imported from implicitly required module" #4690

Closed
titou10titou10 opened this issue Mar 21, 2021 · 2 comments
Assignees
Labels
language/go Issue is related to a Go operator project

Comments

@titou10titou10
Copy link

Bug Report

When following the steps for the Quickstart, the second step (operator-sdk create api) fails

What did you do?

I just followed the steps described in the quickstart

mkdir memcached-operator
cd memcached-operator
operator-sdk init --domain example.com --repo github.com/example/memcached-operator
operator-sdk create api --group cache --version v1alpha1 --kind Memcached --resource --controller

What did you expect to see?

A project ready for the next step, ie"make docker-build docker-push"

What did you see instead? Under which circumstances?

operator-sdk create api --group cache --version v1alpha1 --kind Memcached --resource --controller
Writing scaffold for you to edit...
api/v1alpha1/memcached_types.go
controllers/memcached_controller.go
Running make:
$ make
/data/projets/memcached-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
Error: go [-e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 1: go: github.com/example/memcached-operator/controllers: package github.com/go-logr/logr imported from implicitly required module; to add missing requirements, run:
    go get github.com/go-logr/logr@v0.3.0

Usage:
  controller-gen [flags]
  {...}

Environment

Operator type:

/language go

Kubernetes cluster type:

microk8s

operator-sdk version: "v1.4.2", commit: "4b083393be65589358b3e0416573df04f4ae8d9b", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64"

go version go1.16.2 linux/amd64

Client Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.4-34+1ae8c29bbb48f7", GitCommit:"1ae8c29bbb48f7a11f9b522538a707477322b3ab", GitTreeState:"clean", BuildDate:"2021-03-08T09:25:07Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.4-34+1ae8c29bbb48f7", GitCommit:"1ae8c29bbb48f7a11f9b522538a707477322b3ab", GitTreeState:"clean", BuildDate:"2021-03-08T09:26:35Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
@openshift-ci-robot openshift-ci-robot added the language/go Issue is related to a Go operator project label Mar 21, 2021
@camilamacedo86
Copy link
Contributor

The go1.16.2 is not supported yet. This issue will not be faced if you use the go version >= 1.15+ <1.6 which is the current version supported. To start to support 1.16 we need it be supported in the other projects first such as k8s, controller-runtime and kubebuilder to say a few.

This need is tracked already see: kubernetes-sigs/kubebuilder#2067

However, so far we would like to recommend you use go 1.15.

I am closing this one as sorted out. Thank you for your collaboration.

@titou10titou10
Copy link
Author

Thanks for the quick/clear answer.
As a suggestion, it would be interesting for newbies like me to explicity mention that go versions higher than v1.15 are currently not supported on the installation guide page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project
Projects
None yet
Development

No branches or pull requests

3 participants