Skip to content

Commit 72d9f6a

Browse files
Merge pull request #131 from cert-manager/self-upgrade-main
[CI] Merge self-upgrade-main into main
2 parents 99f7536 + a6cd42e commit 72d9f6a

File tree

5 files changed

+31
-44
lines changed

5 files changed

+31
-44
lines changed

klone.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,55 @@ targets:
99
- folder_name: boilerplate
1010
repo_url: https://github.com/cert-manager/makefile-modules.git
1111
repo_ref: main
12-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
12+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
1313
repo_path: modules/boilerplate
1414
- folder_name: cert-manager
1515
repo_url: https://github.com/cert-manager/makefile-modules.git
1616
repo_ref: main
17-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
17+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
1818
repo_path: modules/cert-manager
1919
- folder_name: controller-gen
2020
repo_url: https://github.com/cert-manager/makefile-modules.git
2121
repo_ref: main
22-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
22+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
2323
repo_path: modules/controller-gen
2424
- folder_name: generate-verify
2525
repo_url: https://github.com/cert-manager/makefile-modules.git
2626
repo_ref: main
27-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
27+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
2828
repo_path: modules/generate-verify
2929
- folder_name: go
3030
repo_url: https://github.com/cert-manager/makefile-modules.git
3131
repo_ref: main
32-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
32+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
3333
repo_path: modules/go
3434
- folder_name: help
3535
repo_url: https://github.com/cert-manager/makefile-modules.git
3636
repo_ref: main
37-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
37+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
3838
repo_path: modules/help
3939
- folder_name: kind
4040
repo_url: https://github.com/cert-manager/makefile-modules.git
4141
repo_ref: main
42-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
42+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
4343
repo_path: modules/kind
4444
- folder_name: klone
4545
repo_url: https://github.com/cert-manager/makefile-modules.git
4646
repo_ref: main
47-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
47+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
4848
repo_path: modules/klone
4949
- folder_name: oci-build
5050
repo_url: https://github.com/cert-manager/makefile-modules.git
5151
repo_ref: main
52-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
52+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
5353
repo_path: modules/oci-build
5454
- folder_name: repository-base
5555
repo_url: https://github.com/cert-manager/makefile-modules.git
5656
repo_ref: main
57-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
57+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
5858
repo_path: modules/repository-base
5959
- folder_name: tools
6060
repo_url: https://github.com/cert-manager/makefile-modules.git
6161
repo_ref: main
62-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
62+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
6363
repo_path: modules/tools

make/_shared/boilerplate/01_mod.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ shared_verify_targets += verify-boilerplate
2828
generate-license:
2929
cp -r $(license_base_dir)/. ./
3030

31-
shared_generate_targets += generate-base
31+
shared_generate_targets += generate-license

make/_shared/oci-build/00_mod.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ fatal_if_undefined = $(if $(findstring undefined,$(origin $1)),$(error $1 is not
2727
fatal_if_deprecated_defined = $(if $(findstring undefined,$(origin $1)),,$(error $1 is deprecated, use $2 instead))
2828

2929
# Validate globals that are required
30-
$(call fatal_if_undefined,bin_dir)
3130
$(call fatal_if_undefined,build_names)
3231

3332
# Set default config values
@@ -98,7 +97,7 @@ ifeq ($(wildcard $(go_$1_mod_dir)/go.mod),)
9897
$$(error go_$1_mod_dir "$(go_$1_mod_dir)" does not contain a go.mod file)
9998
endif
10099
ifeq ($(wildcard $(go_$1_mod_dir)/$(go_$1_main_dir)/main.go),)
101-
$$(error go_$1_main_dir "$(go_$1_mod_dir)" does not contain a main.go file)
100+
$$(error go_$1_main_dir "$(go_$1_mod_dir)/$(go_$1_main_dir)" does not contain a main.go file)
102101
endif
103102

104103
# Validate the config required to build OCI images
@@ -116,19 +115,15 @@ $(foreach build_name,$(build_names),$(eval $(call check_per_build_variables,$(bu
116115
# - oci-build-$(build_name) = build the oci directory
117116
# - oci-load-$(build_name) = load the image into docker using the oci_$(build_name)_image_name_development variable
118117
# - docker-tarball-$(build_name) = build a "docker load" compatible tarball of the image
119-
# - ko-config-$(build_name) = generate "ko" config for a given build
120118
oci_build_targets := $(build_names:%=oci-build-%)
121119
oci_load_targets := $(build_names:%=oci-load-%)
122120
docker_tarball_targets := $(build_names:%=docker-tarball-%)
123-
ko_config_targets := $(build_names:%=ko-config-%)
124121

125122
# Derive config based on user config
126123
#
127124
# - oci_layout_path_$(build_name) = path that the OCI image will be saved in OCI layout directory format
128125
# - oci_digest_path_$(build_name) = path to the file that will contain the digests
129-
# - ko_config_path_$(build_name) = path to the ko config file
130126
# - docker_tarball_path_$(build_name) = path that the docker tarball that the docker-tarball-$(build_name) will produce
131127
$(foreach build_name,$(build_names),$(eval oci_layout_path_$(build_name) := $(bin_dir)/scratch/image/oci-layout-$(build_name)))
132128
$(foreach build_name,$(build_names),$(eval oci_digest_path_$(build_name) := $(CURDIR)/$(oci_layout_path_$(build_name)).digests))
133-
$(foreach build_name,$(build_names),$(eval ko_config_path_$(build_name) := $(CURDIR)/$(oci_layout_path_$(build_name)).ko_config.yaml))
134129
$(foreach build_name,$(build_names),$(eval docker_tarball_path_$(build_name) := $(CURDIR)/$(oci_layout_path_$(build_name)).docker.tar))

make/_shared/oci-build/01_mod.mk

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,30 @@
1515
$(bin_dir)/scratch/image:
1616
@mkdir -p $@
1717

18-
define ko_config_target
19-
.PHONY: $(ko_config_path_$1:$(CURDIR)/%=%)
20-
$(ko_config_path_$1:$(CURDIR)/%=%): | $(NEEDS_YQ) $(bin_dir)/scratch/image
18+
.PHONY: $(oci_build_targets)
19+
## Build the OCI image.
20+
## @category [shared] Build
21+
$(oci_build_targets): oci-build-%: | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(NEEDS_IMAGE-TOOL) $(bin_dir)/scratch/image
22+
rm -rf $(CURDIR)/$(oci_layout_path_$*)
23+
2124
echo '{}' | \
22-
$(YQ) '.defaultBaseImage = "$(oci_$1_base_image)"' | \
23-
$(YQ) '.builds[0].id = "$1"' | \
24-
$(YQ) '.builds[0].dir = "$(go_$1_mod_dir)"' | \
25-
$(YQ) '.builds[0].main = "$(go_$1_main_dir)"' | \
26-
$(YQ) '.builds[0].env[0] = "CGO_ENABLED=$(go_$1_cgo_enabled)"' | \
27-
$(YQ) '.builds[0].env[1] = "GOEXPERIMENT=$(go_$1_goexperiment)"' | \
25+
$(YQ) '.defaultBaseImage = "$(oci_$*_base_image)"' | \
26+
$(YQ) '.builds[0].id = "$*"' | \
27+
$(YQ) '.builds[0].dir = "$(go_$*_mod_dir)"' | \
28+
$(YQ) '.builds[0].main = "$(go_$*_main_dir)"' | \
29+
$(YQ) '.builds[0].env[0] = "CGO_ENABLED=$(go_$*_cgo_enabled)"' | \
30+
$(YQ) '.builds[0].env[1] = "GOEXPERIMENT=$(go_$*_goexperiment)"' | \
2831
$(YQ) '.builds[0].ldflags[0] = "-s"' | \
2932
$(YQ) '.builds[0].ldflags[1] = "-w"' | \
3033
$(YQ) '.builds[0].ldflags[2] = "{{.Env.LDFLAGS}}"' | \
31-
$(YQ) '.builds[0].flags[0] = "$(go_$1_flags)"' | \
32-
$(YQ) '.builds[0].linux_capabilities = "$(oci_$1_linux_capabilities)"' \
33-
> $(CURDIR)/$(oci_layout_path_$1).ko_config.yaml
34-
35-
ko-config-$1: $(ko_config_path_$1:$(CURDIR)/%=%)
36-
endef
34+
$(YQ) '.builds[0].flags[0] = "$(go_$*_flags)"' | \
35+
$(YQ) '.builds[0].linux_capabilities = "$(oci_$*_linux_capabilities)"' \
36+
> $(CURDIR)/$(oci_layout_path_$*).ko_config.yaml
3737

38-
.PHONY: $(ko_config_targets)
39-
$(foreach build_name,$(build_names),$(eval $(call ko_config_target,$(build_name))))
40-
41-
.PHONY: $(oci_build_targets)
42-
## Build the OCI image.
43-
## @category [shared] Build
44-
$(oci_build_targets): oci-build-%: ko-config-% | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(NEEDS_IMAGE-TOOL) $(bin_dir)/scratch/image
45-
rm -rf $(CURDIR)/$(oci_layout_path_$*)
4638
GOWORK=off \
4739
KO_DOCKER_REPO=$(oci_$*_image_name_development) \
4840
KOCACHE=$(CURDIR)/$(bin_dir)/scratch/image/ko_cache \
49-
KO_CONFIG_PATH=$(ko_config_path_$*) \
41+
KO_CONFIG_PATH=$(CURDIR)/$(oci_layout_path_$*).ko_config.yaml \
5042
SOURCE_DATE_EPOCH=$(GITEPOCH) \
5143
KO_GO_PATH=$(GO) \
5244
LDFLAGS="$(go_$*_ldflags)" \

make/_shared/tools/00_mod.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,12 +707,12 @@ endif
707707
non_go_tool_names := $(filter-out $(go_tool_names),$(tool_names))
708708

709709
.PHONY: non-go-tools
710-
## Download and setup all Go tools
710+
## Download and setup all Non-Go tools
711711
## @category [shared] Tools
712712
non-go-tools: $(non_go_tool_names:%=$(bin_dir)/tools/%)
713713

714714
.PHONY: go-tools
715-
## Download and setup all Non-Go tools
715+
## Download and setup all Go tools
716716
## NOTE: this target is also used to learn the shas of
717717
## these tools (see scripts/learn_tools_shas.sh in the
718718
## Makefile modules repo)

0 commit comments

Comments
 (0)