@@ -23,6 +23,8 @@ $(bin_dir)/scratch/image $(bin_dir)/tools $(bin_dir)/downloaded $(bin_dir)/downl
2323
2424checkhash_script := $(dir $(lastword $(MAKEFILE_LIST ) ) ) /util/checkhash.sh
2525
26+ for_each_kv = $(foreach item,$2,$(eval $(call $1,$(word 1,$(subst =, ,$(item ) ) ) ,$(word 2,$(subst =, ,$(item ) ) ) ) ) )
27+
2628# To make sure we use the right version of each tool, we put symlink in
2729# $(bin_dir)/tools, and the actual binaries are in $(bin_dir)/downloaded. When bumping
2830# the version of the tools, this symlink gets updated.
@@ -101,7 +103,7 @@ TOOLS += goreleaser=v1.23.0
101103# https://pkg.go.dev/github.com/anchore/syft/cmd/syft?tab=versions
102104TOOLS += syft=v0.100.0
103105# https://github.com/cert-manager/helm-tool
104- TOOLS += helm-tool=v0.4.1
106+ TOOLS += helm-tool=v0.4.2
105107# https://github.com/cert-manager/cmctl
106108TOOLS += cmctl=2f75014a7c360c319f8c7c8afe8e9ce33fe26dca
107109# https://pkg.go.dev/github.com/cert-manager/release/cmd/cmrel?tab=versions
@@ -307,17 +309,30 @@ GO_DEPENDENCIES += cmctl=github.com/cert-manager/cmctl/v2
307309GO_DEPENDENCIES += cmrel=github.com/cert-manager/release/cmd/cmrel
308310GO_DEPENDENCIES += golangci-lint=github.com/golangci/golangci-lint/cmd/golangci-lint
309311
312+ # ################
313+ # go build tags #
314+ # ################
315+
316+ GO_TAGS :=
317+
310318# Additional Go dependencies can be defined to re-use the tooling in this file
311319ADDITIONAL_GO_DEPENDENCIES ?=
320+ ADDITIONAL_GO_TAGS ?=
312321GO_DEPENDENCIES += $(ADDITIONAL_GO_DEPENDENCIES )
322+ GO_TAGS += $(ADDITIONAL_GO_TAGS )
323+
324+ go_tags_init = go_tags_$1 :=
325+ $(call for_each_kv,go_tags_init,$(GO_DEPENDENCIES))
326+
327+ go_tags_defs = go_tags_$1 += $2
328+ $(call for_each_kv,go_tags_defs,$(GO_TAGS))
313329
314330define go_dependency
315331$$(bin_dir ) /downloaded/tools/$1@$($(call UC,$1) _VERSION) _%: | $$(NEEDS_GO ) $$(bin_dir ) /downloaded/tools
316- GOWORK=off GOBIN=$$(CURDIR ) /$$(dir $$@ ) $$(GO ) install $2@$($(call UC,$1) _VERSION)
332+ GOWORK=off GOBIN=$$(CURDIR ) /$$(dir $$@ ) $$(GO ) install --tags " $( strip $( go_tags_$1 ) ) " $2@$($(call UC,$1) _VERSION)
317333 @mv $$(CURDIR ) /$$(dir $$@ ) /$1 $$@
318334endef
319-
320- $(foreach GO_DEPENDENCY,$(GO_DEPENDENCIES),$(eval $(call go_dependency,$(word 1,$(subst =, ,$(GO_DEPENDENCY))),$(word 2,$(subst =, ,$(GO_DEPENDENCY))))))
335+ $(call for_each_kv,go_dependency,$(GO_DEPENDENCIES))
321336
322337# #######
323338# Helm #
0 commit comments