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

golang/tutorial failed unless I installed kubebuilder #4432

Closed
ErezArbell opened this issue Jan 25, 2021 · 2 comments
Closed

golang/tutorial failed unless I installed kubebuilder #4432

ErezArbell opened this issue Jan 25, 2021 · 2 comments
Labels
language/go Issue is related to a Go operator project

Comments

@ErezArbell
Copy link

Bug Report

This is exactly the same as closed issue #3461

What did you do?

I followed this tutorial today:
https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/

I run it until got to this command:

make docker-build docker-push IMG=<some-registry>/<project-name>:<tag>

What did you expect to see?

Should pass

What did you see instead? Under which circumstances?

Got error:

failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory

Then I installed kubebuilder following this guide: https://book.kubebuilder.io/quick-start.html#installation
The ran again and this time is passed.

Environment

Operator type:

/language go

Kubernetes cluster type:
not sure

$ operator-sdk version

operator-sdk version: "v1.3.0", commit: "1abf57985b43bf6a59dcd18147b3c574fa57d3f6", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64"

$ go version (if language is Go)
go version go1.15.7 linux/amd64

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.5", GitCommit:"e6503f8d8f769ace2f338794c914a96fc335df0f", GitTreeState:"clean", BuildDate:"2020-06-26T03:39:24Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

Possible Solution

Either add kubebuilder to the list of prerequisite or remove the dependency.

Additional context

@openshift-ci-robot openshift-ci-robot added the language/go Issue is related to a Go operator project label Jan 25, 2021
@camilamacedo86
Copy link
Contributor

The following info will be in the FAQ section for the next releases:

Note: If using an OS which does not point sh to the bash shell (Ubuntu for example) then you should add the following line to the Makefile:

SHELL := /bin/bash

This will fix potential issues when the docker-build target runs the controller test suite. Issues maybe similar to following error: failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory occurred

Could you please let me know if it solves your scenario?
Also, @estroz @jmrodri could we not find a solution that is valid for all envs and apply that in upstream?

@estroz
Copy link
Member

estroz commented Jan 26, 2021

The root cause of this issue is make test failing (a dependency of docker-build) because of the shell issue. There are two upstream issues related to this problem (kubernetes-sigs/controller-runtime#1234, kubernetes-sigs/controller-runtime#1300), and the workaround suggested above is documented in the FAQ (will be updated next week), so I'm going to close this.

@estroz estroz closed this as completed Jan 26, 2021
dhaiducek added a commit to stolostron/config-policy-controller that referenced this issue Apr 6, 2021
Fixes error:
```
failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
```
Reference: operator-framework/operator-sdk#4432 (comment)
openshift-merge-robot pushed a commit to stolostron/config-policy-controller that referenced this issue Apr 7, 2021
* go mod tidy

* Change SelfLink --> UID

* Use GetUID()

* Bump KinD to latest

* Remove UID entirely

* Revert overzealous removal

* Set SHELL

Fixes error:
```
failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
```
Reference: operator-framework/operator-sdk#4432 (comment)

* Generalize Bash location

* Update CRDs

* Update v1 CRD
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

4 participants