Skip to content

Commit 2a03ce2

Browse files
Merge pull request #285 from cert-manager/self-upgrade-main
[CI] Merge self-upgrade-main into main
2 parents 4233e91 + fe26cf3 commit 2a03ce2

File tree

5 files changed

+76
-53
lines changed

5 files changed

+76
-53
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
13+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
18+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
23+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
28+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
33+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
38+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
43+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
48+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
53+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: c50107e376014fcc18cc2d1805adf06c649b069c
58+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
63+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
68+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
73+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
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: 17f1b472676a6d4e5a8d3b05367cd42a520b4b04
78+
repo_hash: 78a86c2b07ce327051261ad6930fa7b0811b57cc
7979
repo_path: modules/tools

make/_shared/helm/helm.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,11 @@ verify-helm-lint: $(helm_chart_archive) | $(NEEDS_HELM)
178178
$(HELM) lint $(helm_chart_archive)
179179

180180
shared_verify_targets_dirty += verify-helm-lint
181+
182+
.PHONY: verify-helm-kubeconform
183+
## Verify that the Helm chart passes a strict check using kubeconform
184+
## @category [shared] Generate/ Verify
185+
verify-helm-kubeconform: $(helm_chart_archive) | $(NEEDS_KUBECONFORM)
186+
$(HELM) template kubeconform-template-do-not-use $< | $(KUBECONFORM) -strict
187+
188+
shared_verify_targets_dirty += verify-helm-kubeconform

make/_shared/licenses/00_mod.mk

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,5 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# Utility variables
16-
current_makefile := $(lastword $(MAKEFILE_LIST))
17-
current_makefile_directory := $(dir $(current_makefile))
18-
1915
# Define default config for generating licenses
2016
license_ignore ?=
21-
license_template_file ?=
22-
23-
define license_defaults
24-
license_layer_path_$1 := $(abspath $(bin_dir)/scratch/licenses-$(VERSION))
25-
endef
26-
27-
$(foreach build_name,$(build_names),$(eval $(call license_defaults,$(build_name))))
28-
29-
# Calculate all the go.mod directories, build targets may share go.mod dirs so
30-
# we use $(sort) to de-duplicate.
31-
go_mod_dirs := $(sort $(foreach build_name,$(build_names),$(go_$(build_name)_mod_dir)))
32-
generate_go_licenses_targets := $(addsuffix /LICENSES,$(go_mod_dirs:/=))
33-
34-
.PHONY: $(generate_go_licenses_targets)
35-
$(generate_go_licenses_targets): | $$(NEEDS_GO-LICENSES)
36-
cd $(dir $@) && GOOS=linux GOARCH=amd64 $(GO-LICENSES) report --ignore "$(license_ignore)" ./... > LICENSES
37-
38-
## Generate licenses for the golang dependencies
39-
## @category [shared] Generate/Verify
40-
generate-go-licences: $(generate_go_licenses_targets)
41-
shared_generate_targets += generate-go-licences
42-
43-
# Target to generate image layer containing license information
44-
.PHONY: oci-license-layer-%
45-
oci-license-layer-%: | $(bin_dir)/scratch $$(NEEDS_GO-LICENSES)
46-
rm -rf $(license_layer_path_$*)
47-
mkdir -p $(license_layer_path_$*)/licenses
48-
cd $(go_$*_mod_dir) && GOOS=linux GOARCH=amd64 $(GO-LICENSES) report --ignore "$(license_ignore)" $(addprefix --template=,$(license_template_file)) $(go_$*_main_dir) > $(license_layer_path_$*)/licenses/LICENCES
49-
50-
# Add the license layer to every image
51-
define licences_layer_dependencies
52-
oci-build-$1: oci-license-layer-$1
53-
oci_$1_additional_layers += $(license_layer_path_$1)
54-
endef
55-
$(foreach build_name,$(build_names),$(eval $(call licences_layer_dependencies,$(build_name))))

make/_shared/licenses/01_mod.mk

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2024 The cert-manager Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
###################### Generate LICENSES files ######################
16+
17+
## Generate licenses for the golang dependencies
18+
## @category [shared] Generate/Verify
19+
generate-go-licences: #
20+
shared_generate_targets += generate-go-licences
21+
22+
define license_generate
23+
$1/LICENSES: $1/go.mod | $(NEEDS_GO-LICENSES)
24+
cd $$(dir $$@) && GOOS=linux GOARCH=amd64 $(GO-LICENSES) report --ignore "$$(license_ignore)" ./... > LICENSES
25+
26+
generate-go-licences: $1/LICENSES
27+
endef
28+
29+
# Calculate all the go.mod directories, build targets may share go.mod dirs so
30+
# we use $(sort) to de-duplicate.
31+
go_mod_dirs := $(sort $(foreach build_name,$(build_names),$(go_$(build_name)_mod_dir)))
32+
$(foreach go_mod_dir,$(go_mod_dirs),$(eval $(call license_generate,$(go_mod_dir))))
33+
34+
###################### Include LICENSES in OCI image ######################
35+
36+
define license_layer
37+
license_layer_path_$1 := $$(abspath $(bin_dir)/scratch/licenses-$1)
38+
39+
# Target to generate image layer containing license information
40+
.PHONY: oci-license-layer-$1
41+
oci-license-layer-$1: | $(bin_dir)/scratch $(NEEDS_GO-LICENSES)
42+
rm -rf $$(license_layer_path_$1)
43+
mkdir -p $$(license_layer_path_$1)/licenses
44+
cp LICENSE $$(license_layer_path_$1)/licenses/LICENSE
45+
cp $$(go_$1_mod_dir)/LICENSES $$(license_layer_path_$1)/licenses/LICENSES
46+
47+
oci-build-$1: oci-license-layer-$1
48+
oci_$1_additional_layers += $(license_layer_path_$1)
49+
endef
50+
51+
$(foreach build_name,$(build_names),$(eval $(call license_layer,$(build_name))))

make/_shared/tools/00_mod.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ tools += preflight=1.12.1
138138
tools += gci=v0.13.6
139139
# https://github.com/google/yamlfmt/releases
140140
tools += yamlfmt=v0.16.0
141+
# https://github.com/yannh/kubeconform/releases
142+
tools += kubeconform=v0.6.7
141143

142144
# https://pkg.go.dev/k8s.io/code-generator/cmd?tab=versions
143145
K8S_CODEGEN_VERSION := v0.32.3
@@ -345,6 +347,7 @@ go_dependencies += operator-sdk=github.com/operator-framework/operator-sdk/cmd/o
345347
go_dependencies += gh=github.com/cli/cli/v2/cmd/gh
346348
go_dependencies += gci=github.com/daixiang0/gci
347349
go_dependencies += yamlfmt=github.com/google/yamlfmt/cmd/yamlfmt
350+
go_dependencies += kubeconform=github.com/yannh/kubeconform/cmd/kubeconform
348351

349352
#################
350353
# go build tags #

0 commit comments

Comments
 (0)