From 53532adbb1ee40c523b11b3d8f49a61a01b6300f Mon Sep 17 00:00:00 2001 From: Ivy Jin Date: Wed, 27 Apr 2022 12:24:10 -0500 Subject: [PATCH] Update install workflow to support Go v1.18 (#134) Command 'go get' can no longer be used to build packages starting Go v1.18 (https://go.dev/doc/go-get-install-deprecation). Kustomize version also needs to be updated to v4.5 since go install doesn't support exclude directives (https://github.com/kubernetes-sigs/kustomize/issues/3618). The change has been tested on both Go v1.17 and Go v1.18 to ensure the Makefile works properly. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4a6be191..74b161e7 100644 --- a/Makefile +++ b/Makefile @@ -138,7 +138,7 @@ kubetest2: ## Download kubetest2 locally if necessary. KUSTOMIZE = $(shell pwd)/bin/kustomize kustomize: ## Download kustomize locally if necessary. - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) + $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.2) MOCKGEN = $(shell pwd)/bin/mockgen mockgen: ## Download mockgen locally if necessary. @@ -153,7 +153,7 @@ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ $(GO) mod init tmp ;\ echo "Downloading $(2)" ;\ -GOBIN=$(PROJECT_DIR)/bin $(GO) get $(2) ;\ +GOBIN=$(PROJECT_DIR)/bin $(GO) install $(2) ;\ rm -rf $$TMP_DIR ;\ } endef