diff --git a/Makefile b/Makefile index ac94437bc12f..ea9c79b56394 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,9 @@ ifneq ($(strip $(GINKGO_SKIP)),) _SKIP_ARGS := $(foreach arg,$(strip $(GINKGO_SKIP)),-skip="$(arg)") endif +# Helper function to get dependency version from go.mod +get_go_version = $(shell go list -m $1 | awk '{print $$2}') + # # Binaries. # @@ -125,8 +128,8 @@ CONVERSION_GEN_BIN := conversion-gen CONVERSION_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)) CONVERSION_GEN_PKG := k8s.io/code-generator/cmd/conversion-gen -ENVSUBST_VER := v2.0.0-20210730161058-179042472c46 ENVSUBST_BIN := envsubst +ENVSUBST_VER := $(call get_go_version,github.com/drone/envsubst/v2) ENVSUBST := $(abspath $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)-$(ENVSUBST_VER)) ENVSUBST_PKG := github.com/drone/envsubst/v2/cmd/envsubst @@ -148,8 +151,8 @@ YQ_BIN := yq YQ := $(abspath $(TOOLS_BIN_DIR)/$(YQ_BIN)-$(YQ_VER)) YQ_PKG := github.com/mikefarah/yq/v4 -GINGKO_VER := v2.5.0 GINKGO_BIN := ginkgo +GINGKO_VER := $(call get_go_version,github.com/onsi/ginkgo/v2) GINKGO := $(abspath $(TOOLS_BIN_DIR)/$(GINKGO_BIN)-$(GINGKO_VER)) GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo