Skip to content

Commit 2b4884e

Browse files
committed
run 'make upgrade-klone' and 'make generate'
Signed-off-by: Tim Ramlot <[email protected]>
1 parent 342c0e3 commit 2b4884e

File tree

5 files changed

+150
-136
lines changed

5 files changed

+150
-136
lines changed

klone.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,55 @@ targets:
1010
- folder_name: generate-verify
1111
repo_url: https://github.com/cert-manager/makefile-modules.git
1212
repo_ref: main
13-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
13+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
1414
repo_path: modules/generate-verify
1515
- folder_name: go
1616
repo_url: https://github.com/cert-manager/makefile-modules.git
1717
repo_ref: main
18-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
18+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
1919
repo_path: modules/go
2020
- folder_name: helm
2121
repo_url: https://github.com/cert-manager/makefile-modules.git
2222
repo_ref: main
23-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
23+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
2424
repo_path: modules/helm
2525
- folder_name: help
2626
repo_url: https://github.com/cert-manager/makefile-modules.git
2727
repo_ref: main
28-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
28+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
2929
repo_path: modules/help
3030
- folder_name: kind
3131
repo_url: https://github.com/cert-manager/makefile-modules.git
3232
repo_ref: main
33-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
33+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
3434
repo_path: modules/kind
3535
- folder_name: klone
3636
repo_url: https://github.com/cert-manager/makefile-modules.git
3737
repo_ref: main
38-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
38+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
3939
repo_path: modules/klone
4040
- folder_name: licenses
4141
repo_url: https://github.com/cert-manager/makefile-modules.git
4242
repo_ref: main
43-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
43+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
4444
repo_path: modules/licenses
4545
- folder_name: oci-build
4646
repo_url: https://github.com/cert-manager/makefile-modules.git
4747
repo_ref: main
48-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
48+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
4949
repo_path: modules/oci-build
5050
- folder_name: oci-publish
5151
repo_url: https://github.com/cert-manager/makefile-modules.git
5252
repo_ref: main
53-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
53+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
5454
repo_path: modules/oci-publish
5555
- folder_name: repository-base
5656
repo_url: https://github.com/cert-manager/makefile-modules.git
5757
repo_ref: main
58-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
58+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
5959
repo_path: modules/repository-base
6060
- folder_name: tools
6161
repo_url: https://github.com/cert-manager/makefile-modules.git
6262
repo_ref: main
63-
repo_hash: 2a0b032b3a629076796e8760c59c29428c60ce0d
63+
repo_hash: c3d364ac4221b114f9b31e755ed328c541246330
6464
repo_path: modules/tools
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{- end }}
1+
{{- end }}

make/_shared/helm/crd.template.header.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ metadata:
88
helm.sh/resource-policy: keep
99
{{- end }}
1010
labels:
11-
{{- include "REPLACE_LABELS_TEMPLATE" . | nindent 4 }}
11+
{{- include "REPLACE_LABELS_TEMPLATE" . | nindent 4 }}

make/_shared/helm/crds.mk

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ endif
4040
crds_dir ?= deploy/crds
4141
crds_dir_readme := $(dir $(lastword $(MAKEFILE_LIST)))/crds_dir.README.md
4242
crds_expression ?= .Values.crds.enabled
43+
crds_template_include_pattern := *.yaml
44+
# Space-separated list of basenames to exclude (e.g. foo.yaml *_test.yaml)
45+
crds_template_exclude_pattern ?=
46+
47+
define filter-out-basenames
48+
$(if $(strip $(2)), \
49+
$(foreach f,$(1),$(if $(filter $(2),$(notdir $(f))),,$(f))), \
50+
$(1))
51+
endef
4352

4453
.PHONY: generate-crds
4554
## Generate CRD manifests.
@@ -57,15 +66,20 @@ generate-crds: | $(NEEDS_CONTROLLER-GEN) $(NEEDS_YQ)
5766

5867
@echo "Updating CRDs with helm templating, writing to $(helm_chart_source_dir)/templates"
5968

60-
@for i in $$(ls $(crds_gen_temp)); do \
61-
crd_name=$$($(YQ) eval '.metadata.name' $(crds_gen_temp)/$$i); \
62-
cat $(crd_template_header) > $(helm_chart_source_dir)/templates/crd-$$i; \
63-
echo "" >> $(helm_chart_source_dir)/templates/crd-$$i; \
64-
$(sed_inplace) "s/REPLACE_CRD_EXPRESSION/$(crds_expression)/g" $(helm_chart_source_dir)/templates/crd-$$i; \
65-
$(sed_inplace) "s/REPLACE_CRD_NAME/$$crd_name/g" $(helm_chart_source_dir)/templates/crd-$$i; \
66-
$(sed_inplace) "s/REPLACE_LABELS_TEMPLATE/$(helm_labels_template_name)/g" $(helm_chart_source_dir)/templates/crd-$$i; \
67-
$(YQ) -I2 '{"spec": .spec}' $(crds_gen_temp)/$$i >> $(helm_chart_source_dir)/templates/crd-$$i; \
68-
cat $(crd_template_footer) >> $(helm_chart_source_dir)/templates/crd-$$i; \
69+
$(eval crds_gen_temp_all_files := $(wildcard $(crds_gen_temp)/$(crds_template_include_pattern)))
70+
$(eval crds_gen_temp_files := $(if $(crds_template_exclude_pattern), \
71+
$(call filter-out-basenames,$(crds_gen_temp_all_files),$(crds_template_exclude_pattern)), \
72+
$(crds_gen_temp_all_files)))
73+
74+
@for f in $(crds_gen_temp_files); do \
75+
crd_name=$$($(YQ) eval '.metadata.name' $$f); \
76+
crd_template_file="$(helm_chart_source_dir)/templates/crd-$$(basename $$f)"; \
77+
cat $(crd_template_header) > $$crd_template_file; \
78+
$(sed_inplace) "s/REPLACE_CRD_EXPRESSION/$(crds_expression)/g" $$crd_template_file; \
79+
$(sed_inplace) "s/REPLACE_CRD_NAME/$$crd_name/g" $$crd_template_file; \
80+
$(sed_inplace) "s/REPLACE_LABELS_TEMPLATE/$(helm_labels_template_name)/g" $$crd_template_file; \
81+
$(YQ) -I2 '{"spec": .spec}' $$f >> $$crd_template_file; \
82+
cat $(crd_template_footer) >> $$crd_template_file; \
6983
done
7084

7185
@if [ -n "$$(ls $(crds_gen_temp) 2>/dev/null)" ]; then \

0 commit comments

Comments
 (0)