You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If controller-gen or kustomize are not found, my understanding is that those binaries are downloaded and installed in $(GOBIN) which may lead to issues as it may override the version one has already downloaded:
# find or download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif
kustomize:
ifeq (, $(shell which kustomize))
@{ \
set -e ;\
KUSTOMIZE_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$KUSTOMIZE_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/kustomize/kustomize/v3@v3.5.4 ;\
rm -rf $$KUSTOMIZE_GEN_TMP_DIR ;\
}
KUSTOMIZE=$(GOBIN)/kustomize
else
KUSTOMIZE=$(shell which kustomize)
endif
I think any project specific binary should be downloaded and installed on a temporary location relative to the project root
The text was updated successfully, but these errors were encountered:
@lburgazzoli my understanding is that overwriting only happens when GOBIN isn't in the PATH, which I would assume to be unusual. Otherwise, the existing version is used and not overwritten. That being said, I agree it'd be better to be completely environment independent, and install the binaries in temp dir local to the project.
Ah yes, that should be how it works however I spotted the issue because my environment was non properly set up and GOBIN was non on the path for some unknown reasons so the first invocation leaded to my own controller-gen being replaced and being re-download at each make invocation.
This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!
If
controller-gen
orkustomize
are not found, my understanding is that those binaries are downloaded and installed in $(GOBIN) which may lead to issues as it may override the version one has already downloaded:I think any project specific binary should be downloaded and installed on a temporary location relative to the project root
The text was updated successfully, but these errors were encountered: