From 6c4c9145b3a7b22de9d7f8172df3a0c170f30bf9 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Sat, 28 May 2022 00:08:49 -0400 Subject: [PATCH 1/2] Github Actions: go-test go version bump to 1.18 kustomize v4 can be installed via go install Github Actions: go-test go version bump to 1.18 kustomize v3->v4 breaking changes related to supported url types don't affect our repo --- .github/workflows/go-tests.yml | 2 +- Makefile | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index e5fe7d79cf..7ae84863a6 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: '^1.16.6' # The Go version to download (if necessary) and use. + go-version: '^1.18' # The Go version to download (if necessary) and use. - run: go version - run: make test submit-coverage podman-build: diff --git a/Makefile b/Makefile index 9934275169..8686a2437a 100644 --- a/Makefile +++ b/Makefile @@ -229,15 +229,15 @@ build-deploy: ## Build current branch image and deploy controller to the k8s clu CONTROLLER_GEN = $(shell pwd)/bin/controller-gen controller-gen: ## Download controller-gen locally if necessary. - $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1) + $(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1) 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-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5) ENVTEST = $(shell pwd)/bin/setup-envtest envtest: ## Download envtest-setup locally if necessary. - $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) + $(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) # Codecov OS String for use in download url ifeq ($(OS),Windows_NT) @@ -264,16 +264,16 @@ submit-coverage: fi rm -f codecov tmp.* -# go-get-tool will 'go get' any package $2 and install it to $1. +# go-install-tool will 'go install' any package $2 and install it to $1. PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) -define go-get-tool +define go-install-tool @[ -f $(1) ] || { \ set -e ;\ 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 From 22c68ed3668cb998c62af5d63efcbb0a9e26834c Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Wed, 8 Jun 2022 17:04:08 -0400 Subject: [PATCH 2/2] -mod=mod --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8686a2437a..f4d94b573c 100644 --- a/Makefile +++ b/Makefile @@ -273,7 +273,7 @@ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ go mod init tmp ;\ echo "Downloading $(2)" ;\ -GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ +GOBIN=$(PROJECT_DIR)/bin go install -mod=mod $(2) ;\ rm -rf $$TMP_DIR ;\ } endef