Skip to content

Commit fbd3995

Browse files
Merge pull request #392 from cert-manager/self-upgrade-main
[CI] Merge self-upgrade-main into main
2 parents 55acf95 + ea0da1f commit fbd3995

File tree

5 files changed

+34
-47
lines changed

5 files changed

+34
-47
lines changed

klone.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,70 @@ targets:
1010
- folder_name: boilerplate
1111
repo_url: https://github.com/cert-manager/makefile-modules.git
1212
repo_ref: main
13-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
13+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
1414
repo_path: modules/boilerplate
1515
- folder_name: cert-manager
1616
repo_url: https://github.com/cert-manager/makefile-modules.git
1717
repo_ref: main
18-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
18+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
1919
repo_path: modules/cert-manager
2020
- folder_name: controller-gen
2121
repo_url: https://github.com/cert-manager/makefile-modules.git
2222
repo_ref: main
23-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
23+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
2424
repo_path: modules/controller-gen
2525
- folder_name: generate-verify
2626
repo_url: https://github.com/cert-manager/makefile-modules.git
2727
repo_ref: main
28-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
28+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
2929
repo_path: modules/generate-verify
3030
- folder_name: go
3131
repo_url: https://github.com/cert-manager/makefile-modules.git
3232
repo_ref: main
33-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
33+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
3434
repo_path: modules/go
3535
- folder_name: helm
3636
repo_url: https://github.com/cert-manager/makefile-modules.git
3737
repo_ref: main
38-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
38+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
3939
repo_path: modules/helm
4040
- folder_name: help
4141
repo_url: https://github.com/cert-manager/makefile-modules.git
4242
repo_ref: main
43-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
43+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
4444
repo_path: modules/help
4545
- folder_name: kind
4646
repo_url: https://github.com/cert-manager/makefile-modules.git
4747
repo_ref: main
48-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
48+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
4949
repo_path: modules/kind
5050
- folder_name: klone
5151
repo_url: https://github.com/cert-manager/makefile-modules.git
5252
repo_ref: main
53-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
53+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
5454
repo_path: modules/klone
5555
- folder_name: licenses
5656
repo_url: https://github.com/cert-manager/makefile-modules.git
5757
repo_ref: main
58-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
58+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
5959
repo_path: modules/licenses
6060
- folder_name: oci-build
6161
repo_url: https://github.com/cert-manager/makefile-modules.git
6262
repo_ref: main
63-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
63+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
6464
repo_path: modules/oci-build
6565
- folder_name: oci-publish
6666
repo_url: https://github.com/cert-manager/makefile-modules.git
6767
repo_ref: main
68-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
68+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
6969
repo_path: modules/oci-publish
7070
- folder_name: repository-base
7171
repo_url: https://github.com/cert-manager/makefile-modules.git
7272
repo_ref: main
73-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
73+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
7474
repo_path: modules/repository-base
7575
- folder_name: tools
7676
repo_url: https://github.com/cert-manager/makefile-modules.git
7777
repo_ref: main
78-
repo_hash: 6d5cc44645b0b9f0d2e23f0a28f981f942085fea
78+
repo_hash: b28a6c7b188e2c3c6540779d4f036db4d54de9f1
7979
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)