operator-sdk: Kubebuilder is not listed in prerequisites
Bug Report
Kubebuilder is Tightly coupled in requirements, which is fine but…
kubebuilder
is not listed in Prerequisitesmake docker-build ...
expects kubebuilder inusr/local/kubebuilder
only otherwise it raises an error, which I don’t think is a good idea. User may have kubebuilder anywhere in PATH.
What did you do?
make docker-build $IMG
What did you expect to see?
resolves kubebuilder from $PATH
not from any Specific Location.
What did you see instead? Under which circumstances?
Failure [0.002 seconds]
[BeforeSuite] BeforeSuite
/home/deepak/projects/go/src/operator/newoperator3/final/crda-operator/controllers/suite_test.go:52
Unexpected error:
<*fmt.wrapError | 0xc00046c2a0>: {
msg: "failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory",
err: {
Op: "fork/exec",
Path: "/usr/local/kubebuilder/bin/etcd",
Err: 0x2,
},
}
failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
occurred
/home/deepak/projects/go/src/operator/newoperator3/final/crda-operator/controllers/suite_test.go:62
------------------------------
Ran 0 of 0 Specs in 0.002 seconds
FAIL! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
--- FAIL: TestAPIs (0.00s)
FAIL
coverage: 0.0% of statements
FAIL github.com/deepak1725/crda-operator/controllers 0.010s
FAIL
make: *** [Makefile:30: test] Error 1
Environment
-
operator-sdk version: 0.19
-
go version: 0.14
-
Kubernetes version information: 1.18
-
Kubernetes cluster kind: minikube
-
Are you writing your operator in ansible, helm, or go? go
Possible Solution
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 9
- Comments: 23 (14 by maintainers)
Yep, I think this is a user-experience issue. If I have to do some research to rename a path for kubebuilder manually through some riga-maru, I don’t think most users will find this edge case very friendly. I’d suggest an automated solution to prevent this error.
@kansberry
make test
is giving you that error? If you addto your Makefile, what happens?
It is applied to the 0.19 already. See; https://v0-19-x.sdk.operatorframework.io/docs/golang/references/env-test-setup/ and the PR: https://github.com/operator-framework/operator-sdk/pull/3517
All done. We can improve the docs in the future as well. Really tks for raise that.
Hi @deepak1725,
See that we added a script to upstream to do this setup and we have a pr against master https://github.com/operator-framework/operator-sdk/pull/3510 and against 0.19.x https://github.com/operator-framework/operator-sdk/pull/3517 to update the docs.
PR to fix it for v3 in Kubebuilder; https://github.com/kubernetes-sigs/kubebuilder/pull/1600