Skip to content

Commit 8763b8a

Browse files
authored
Use go install in Makefile instead of go get (#984)
In go1.17 installing binaries using go get is deprecated and removed in 1.18. https://go.dev/doc/go-get-install-deprecation
1 parent 92693cd commit 8763b8a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ all-images: operator-image e2e-image agent-image readiness-probe-image version-u
157157
# Download controller-gen locally if necessary
158158
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
159159
controller-gen:
160-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])
160+
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])
161161

162162
# Download helm locally if necessary
163163
HELM = /usr/local/bin/helm
@@ -177,16 +177,16 @@ rm -rf $(TMP_DIR) ;\
177177
}
178178
endef
179179

180-
# go-get-tool will 'go get' any package $2 and install it to $1.
180+
# go-install-tool will 'go install' any package $2 and install it to $1.
181181
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
182-
define go-get-tool
182+
define go-install-tool
183183
@[ -f $(1) ] || { \
184184
set -e ;\
185185
TMP_DIR=$$(mktemp -d) ;\
186186
cd $$TMP_DIR ;\
187187
go mod init tmp ;\
188188
echo "Downloading $(2)" ;\
189-
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
189+
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
190190
rm -rf $$TMP_DIR ;\
191191
}
192192
endef

0 commit comments

Comments
 (0)