kubebuilder: Missing Kustomize Dependency for `make install`
Fresh linux system, trying to go through the getting started
[nova@nova kapad]$ make install
/home/nova/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
kustomize build config/crd | kubectl apply -f -
/bin/sh: kustomize: command not found
error: no objects passed to apply
make: *** [Makefile:30: install] Error 1
Either docs that mention this, a check in make install, a better error message with a path forward, or including kustomize in the build/bin/ directory of a release
/kind bug
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (19 by maintainers)
Commits related to this issue
- Check For Prerequisites For Scaffolded Makefile This commit checks that the prequisites listed in the Kubebuilder book are in `$PATH` before proceeding with any target. We probably want the user to ... — committed to dmizelle/kubebuilder by dmizelle 4 years ago
- Check For Prerequisites For Scaffolded Makefile This commit checks that the prerequisites listed in the Kubebuilder book are in `$PATH` before proceeding with any target. We probably want the user t... — committed to dmizelle/kubebuilder by dmizelle 4 years ago
Hi @Adirio,
I think that go is a pre-requirement that could not be changed. However, doing it by the Makefile allows the user to customize it which shows more appropriate in this case. So, I am inclined to say for we forward with #1430.
I agree with @camilamacedo86 that checking the dependency could be done. I don’t think there is any other easy way to improve the error message, as it is a OS error not one we are printing, so we need to check for it before running any kustomize command.
IHMO, the kustomize is a requirement dependence such as the controller-gen and the solution in #1430 make it easier for the users and bring better experience, also address the issue raised here and still allowing users customize it according to their needs since the implementation is in the makefile. Then, I cannot see any reason why not move forward with #1430.
@mengqiy @DirectXMan12 wdyt ?
I’ve commented this on #1430, but ideally the dependencies like controller-gen and kustomize should only be installed locally (eg. local to the project). This could be in
${PROJECT_DIR}/binfor example.As they are internal dependencies in my opinion, they should not change the external environment (and ideally not be influenced by it either, all though that would break backwards compatibility).
Anyways, this is perfectionistic, so I would simply go with #1430 as well!
HI @bharathi-tenneti,
It is not about the makefile of the kubebuilder project. The makefile in the kubebuilder project are targets which are helpful for who will contribute with the project.
In this scenario, the user says
Fresh linux system, trying to go through the getting startedwhich means that he is following the Quick Started and the issue is faced in the step:So, what @droot is suggesting here as the solution is:
Improve the error face in this scenario in order to allow users to know that the prerequisite kustomize is not installed. Also, I would recommend we solve it by checking the pre-requirement is install as we do for the Go version see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/cmd/internal/go_version.go