Skip to content

Commit

Permalink
fix operator build - controller-gen install for go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gsunner authored and seldondev committed Jan 14, 2020
1 parent c687012 commit 00e50db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ kind-image-install: docker-build
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
go get sigs.k8s.io/controller-tools/cmd/[email protected]
@{ \
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/[email protected] ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
Expand Down

0 comments on commit 00e50db

Please sign in to comment.