From 3c2426fe2fa1678b20269ad5a35b06205eee71d5 Mon Sep 17 00:00:00 2001 From: cert-manager-bot Date: Wed, 26 Jun 2024 00:38:53 +0000 Subject: [PATCH] BOT: run 'make upgrade-klone' and 'make generate' Signed-off-by: cert-manager-bot --- klone.yaml | 26 +++++++++++++------------- make/_shared/go/01_mod.mk | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/klone.yaml b/klone.yaml index 4ecbb5ad..dd72ac6b 100644 --- a/klone.yaml +++ b/klone.yaml @@ -10,65 +10,65 @@ targets: - folder_name: boilerplate repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/boilerplate - folder_name: cert-manager repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/cert-manager - folder_name: controller-gen repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/controller-gen - folder_name: generate-verify repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/generate-verify - folder_name: go repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/go - folder_name: helm repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/helm - folder_name: help repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/help - folder_name: kind repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/kind - folder_name: klone repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/klone - folder_name: oci-build repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/oci-build - folder_name: oci-publish repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/oci-publish - folder_name: repository-base repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/repository-base - folder_name: tools repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: 96530a5ed1a52c40cdf6b2469ad49fa5a13ab7c0 + repo_hash: cb3ebf9f13251b918c162335069ad7a64f839438 repo_path: modules/tools diff --git a/make/_shared/go/01_mod.mk b/make/_shared/go/01_mod.mk index 0e4d4185..9a28ed31 100644 --- a/make/_shared/go/01_mod.mk +++ b/make/_shared/go/01_mod.mk @@ -23,6 +23,41 @@ endif go_base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/ golangci_lint_override := $(dir $(lastword $(MAKEFILE_LIST)))/.golangci.override.yaml +.PHONY: go-workspace +go-workspace: export GOWORK?=$(abspath go.work) +## Create a go.work file in the repository root (or GOWORK) +## +## @category Development +go-workspace: | $(NEEDS_GO) + @rm -f $(GOWORK) + $(GO) work init + @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \ + | while read d; do \ + target=$$(dirname $${d}); \ + $(GO) work use "$${target}"; \ + done + +.PHONY: go-tidy +## Alias for `make generate-go-mod-tidy` +## @category [shared] Generate/ Verify +go-tidy: generate-go-mod-tidy + +.PHONY: generate-go-mod-tidy +## Run `go mod tidy` on all Go modules +## @category [shared] Generate/ Verify +generate-go-mod-tidy: | $(NEEDS_GO) + @find . -name go.mod -not \( -path "./$(bin_dir)/*" -or -path "./make/_shared/*" \) \ + | while read d; do \ + target=$$(dirname $${d}); \ + echo "Running 'go mod tidy' in directory '$${target}'"; \ + pushd "$${target}" >/dev/null; \ + $(GO) mod tidy || exit; \ + popd >/dev/null; \ + echo ""; \ + done + +shared_generate_targets += generate-go-mod-tidy + .PHONY: generate-govulncheck ## Generate base files in the repository ## @category [shared] Generate/ Verify