Kubebuilder: go-logr/logr imported from implicitly required module, missing requirements error

Created on 10 Mar 2021  路  3Comments  路  Source: kubernetes-sigs/kubebuilder

package github.com/go-logr/logr imported from implicitly required module; to add missing requirements, run:
go get github.com/go-logr/[email protected]

root@kh-dev:~/workspace/hypercloud-ovirt-operator# kubebuilder create api --group batch --version v1 --kind CronJob
Create Resource [y/n]
y
Create Controller [y/n]
y
Writing scaffold for you to edit...
api/v1/cronjob_types.go
controllers/cronjob_controller.go
Running make:
$ make
go: creating new go.mod: module tmp
go get: added sigs.k8s.io/controller-tools v0.2.5
/root/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
Error: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 1: go: github.com/tmax-cloud/hypercloud-ovirt-operator/controllers: package github.com/go-logr/logr imported from implicitly required module; to add missing requirements, run:
go get github.com/go-logr/[email protected]

Usage:
controller-gen [flags]

run controller-gen object:headerFile=hack/boilerplate.go.txt paths=./... -w to see all available markers, or controller-gen object:headerFile=hack/boilerplate.go.txt paths=./... -h for usage
Makefile:55: recipe for target 'generate' failed
make: * [generate] Error 1
2021/03/10 15:33:06 failed to create API: exit status 2

Error: go [list -e -json -compiled=true -test=false -export=false -deps=true -find=false -tags ignore_autogenerated -- ./...]: exit status 1: go: github.com/tmax-cloud/hypercloud-ovirt-operator/controllers: package github.com/go-logr/logr imported from implicitly required module; to add missing requirements, run:
go get github.com/go-logr/[email protected]

api/v1 and controllers boilerplate generated.

  • go version

go version go1.16 linux/amd64

  • kubebuilder version (kubebuilder version) and scaffolding version (check your PROJECT file)

Version: version.Version{KubeBuilderVersion:"2.3.2", KubernetesVendor:"1.16.4", GitCommit:"5da27b892ae310e875c8719d94a5a04302c597d0", BuildDate:"2021-02-16T19:31:47Z", GoOs:"unknown", GoArch:"unknown"}

```domain: tutorial.tmax.io
repo: github.com/tmax-cloud/hypercloud-ovirt-operator
resources:

  • group: batch
    kind: CronJob
    version: v1
    version: "2"
    ```
  • controller-runtime version (check your go.mod file)

sigs.k8s.io/controller-runtime v0.5.0

/kind bug

kinsupport

Most helpful comment

Go 1.16 is not officially supported, use it at your own risk.

One of the changes introduced by Go 1.16 is that module aware go subcommands that were previously silently updating go.mod don't do it anymore. Running go mod tidy should fix this, and a PR was already merged to master to run go mod tidy after some subcommand calls.

Closing this as it is not a bug as Go 1.16 is not supported, and even when we support 1.16 a fix has already been merged.

/remove-kind bug
/kind support
/close

All 3 comments

I've cleaned all the files and started again with kubebuilder init. Added go get github.com/go-logr/[email protected]
go get github.com/onsi/[email protected]
go get github.com/onsi/[email protected].
Following the kubebuilder create api, now I get the correct response.

Go 1.16 is not officially supported, use it at your own risk.

One of the changes introduced by Go 1.16 is that module aware go subcommands that were previously silently updating go.mod don't do it anymore. Running go mod tidy should fix this, and a PR was already merged to master to run go mod tidy after some subcommand calls.

Closing this as it is not a bug as Go 1.16 is not supported, and even when we support 1.16 a fix has already been merged.

/remove-kind bug
/kind support
/close

@Adirio: Closing this issue.

In response to this:

Go 1.16 is not officially supported, use it at your own risk.

One of the changes introduced by Go 1.16 is that module aware go subcommands that were previously silently updating go.mod don't do it anymore. Running go mod tidy should fix this, and a PR was already merged to master to run go mod tidy after some subcommand calls.

Closing this as it is not a bug as Go 1.16 is not supported, and even when we support 1.16 a fix has already been merged.

/remove-kind bug
/kind support
/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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

champak picture champak  路  4Comments

alok87 picture alok87  路  4Comments

camilamacedo86 picture camilamacedo86  路  4Comments

bingosummer picture bingosummer  路  6Comments

cheyang picture cheyang  路  4Comments