operator-sdk: Problem with "make: *** [generate] Error 127"

Bug Report

What did you do?

operator-sdk init --domain myproblemfix.net --repo github.com/myproblemfix/myproblemfix
operator-sdk create api --group myproblemfix --version v1alpha1 --kind Myproblemfix --resource --controller

What did you expect to see?

No error!

What did you see instead? Under which circumstances?

Creates following problem: make: *** [generate] Error 127

/fixproblem/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
/fixproblem/bin/controller-gen: No such file or directory
make: *** [generate] Error 127
Error: failed to create API: unable to run post-scaffold tasks of "base.go.kubebuilder.io/v3": exit status 2

Simply the bin directory with the needed controller-gen, kustomize and setup-envtest files, wasn’t created by operator-sdk commands.

Environment

Operator type:

/language go

Kubernetes cluster type:

$ operator-sdk version

operator-sdk version: "v1.19.1", commit: "079d8852ce5b42aa5306a1e33f7ca725ec48d0e3", kubernetes version: "v1.23", go version: "go1.18.1", GOOS: "darwin", GOARCH: "amd64"

$ go version (if language is Go)

go version go1.18.1 darwin/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5", GitCommit:"c285e781331a3785a7f436042c65c5641ce8a9e9", GitTreeState:"clean", BuildDate:"2022-03-16T15:51:05Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5+IKS", GitCommit:"fdfd7e9e0e8243bfb4084651da5d18e7c74dce10", GitTreeState:"clean", BuildDate:"2022-03-17T13:32:26Z", GoVersion:"go1.17.8", Compiler:"gc", Platform:"linux/amd64"}

Possible Solution

Copy and past an existing bin directory with the files from an existing working project to that not working project.

Additional context

No additional context.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

PR has been created in the Homebrew/homebrew-core repo here: https://github.com/Homebrew/homebrew-core/pull/100353

@thomassuedbroecker I believe that this should resolve any problems when installing with Homebrew and not having had an existing Go installation. Once we have support for go 1.18 I will make sure to update the formula again

@camilamacedo86 we may not maintain it, but seeing as it is an installation method we support I figured it would likely impact a decent number of our users.

I found that the formula for operator-sdk can be found here: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/operator-sdk.rb

I am thinking to make a PR to modify the dependency on go to be on go@1.17.

Hi team, we like the operator SDK a lot.

Please fix the issue above! The first time experience of the SDK is not good right now.

Thomas, Alain, I and others have built this repo to promote operators: https://github.com/IBM/operator-sample-go The missing bin files are a blocker to get lots of people to build operators right now. We don’t want to loose time telling people how to get the missing bin files first but start right away with value like automation of day 2 tasks.

Hi @everettraven, I created a blog post how it works for me MAKE: *** [GENERATE] ERROR 127.

@thomassuedbroecker Thanks for pointing out that Homebrew shows go 1.18 as a dependency! I will take a look at what needs to be changed.

Hi @nheidloff,

The go 1.18 is not supported yet. This issue does not occur with 1.17. Brew formula should not require the go version 1.18. See that we are blocked here and we will only be able to provide this support when 1.24 k8s be released as others deps.

Hi @everettraven, thanks for your feedback, but why is following information available on brew formula ? (following the instructions for macOS on operator-sdk)

The required version of golang for the actual operator-sdk 19.x is go 1.18.1:

operator-problem

Hi @everettraven,

I do not think that we maintain the brew formula. But the solution here would make the brew formula use 1.17 instead.