diff --git a/klone.yaml b/klone.yaml index 78e34cc0..dc637655 100644 --- a/klone.yaml +++ b/klone.yaml @@ -10,55 +10,55 @@ targets: - folder_name: boilerplate repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/boilerplate - folder_name: cert-manager repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/cert-manager - folder_name: controller-gen repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/controller-gen - folder_name: generate-verify repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/generate-verify - folder_name: helm repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/helm - folder_name: help repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/help - folder_name: kind repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/kind - folder_name: klone repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/klone - folder_name: oci-image repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/oci-image - folder_name: repository-base repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/repository-base - folder_name: tools repo_url: https://github.com/cert-manager/makefile-modules.git repo_ref: main - repo_hash: dc8ce162c76ca7b95f80157aefa4afb9d2783b82 + repo_hash: c4dba5d8d7d65efbd1b232e81d7c95996c6989fb repo_path: modules/tools diff --git a/make/_shared/cert-manager/00_mod.mk b/make/_shared/cert-manager/00_mod.mk index f545fc86..2b9a5cd3 100644 --- a/make/_shared/cert-manager/00_mod.mk +++ b/make/_shared/cert-manager/00_mod.mk @@ -15,14 +15,14 @@ images_amd64 ?= images_arm64 ?= -cert_manager_version := v1.12.3 +cert_manager_version := v1.13.3 -images_amd64 += quay.io/jetstack/cert-manager-controller:$(cert_manager_version)@sha256:6b9b696c2e56aaef5bf7e0b659ee91a773d0bb8f72b0eb4914a9db7e87578d47 -images_amd64 += quay.io/jetstack/cert-manager-cainjector:$(cert_manager_version)@sha256:31ffa7640020640345a34f3fe6964560665e7ca89d818a6c455e63f5c4f5eb14 -images_amd64 += quay.io/jetstack/cert-manager-webhook:$(cert_manager_version)@sha256:292facf28fd4f0db074fed12437669eef9c0ab8c1b9812d2c91e42b4a7448a36 -images_amd64 += quay.io/jetstack/cert-manager-ctl:$(cert_manager_version)@sha256:5c985c4ebd8da6592cbe0249936f7513c0527488d754198699b3be9389b8b587 +images_amd64 += quay.io/jetstack/cert-manager-controller:$(cert_manager_version)@sha256:3490283b7a8fb4e13d9864963f94ab710fc2d669d3d53608f01608c887d4f741 +images_amd64 += quay.io/jetstack/cert-manager-cainjector:$(cert_manager_version)@sha256:c3a5ce22b8521e1a0a792152540cbbcb3ef8d509c9f3583cffb6b4e9a5b7bd60 +images_amd64 += quay.io/jetstack/cert-manager-webhook:$(cert_manager_version)@sha256:afe9a27be1e6b3847d6483eb9a83b20fb8576ba5c314f381a90b185af022a105 +images_amd64 += quay.io/jetstack/cert-manager-ctl:$(cert_manager_version)@sha256:38f549eba224094c6810c088e5f8e257690dc882956234b8db3cad15c6253822 -images_arm64 += quay.io/jetstack/cert-manager-controller:$(cert_manager_version)@sha256:f2adb86c11c305dcb78607cdf86fa232e657d196f82d0592799aebbfea22dec8 -images_arm64 += quay.io/jetstack/cert-manager-cainjector:$(cert_manager_version)@sha256:118b985b0f0051ee9c428a3736c47bea92c3d8e7cb7c6eda881f7ecd4430cbed -images_arm64 += quay.io/jetstack/cert-manager-webhook:$(cert_manager_version)@sha256:0195441dc0f7f81e7514e6497bf68171bc54ef8481efc5fa0efe51892bd28c36 -images_arm64 += quay.io/jetstack/cert-manager-ctl:$(cert_manager_version)@sha256:f376994ae17c519b12dd59c406a0abf8c6265c5f0c57431510eee15eaa40e4eb +images_arm64 += quay.io/jetstack/cert-manager-controller:$(cert_manager_version)@sha256:2ec91011538846690da6c236e51ef0221b2e3dbd45de41cce6dfa16d531a4dc4 +images_arm64 += quay.io/jetstack/cert-manager-cainjector:$(cert_manager_version)@sha256:1bdddcf53317991f01be03cffc126b10df4136556e0440836bee07a192dcc3f5 +images_arm64 += quay.io/jetstack/cert-manager-webhook:$(cert_manager_version)@sha256:04c79086f1e3440bac8b584304fe5444d6184c5345c7e7115147ee39d4591d2e +images_arm64 += quay.io/jetstack/cert-manager-ctl:$(cert_manager_version)@sha256:f0755d949d0facd64550d2f1e2f974ce5592a199b84772fd9ab4a97a2a19a609 diff --git a/make/_shared/generate-verify/00_mod.mk b/make/_shared/generate-verify/00_mod.mk index c755a3d4..9b145a95 100644 --- a/make/_shared/generate-verify/00_mod.mk +++ b/make/_shared/generate-verify/00_mod.mk @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Shared targets are set by other Makefile modules. shared_generate_targets ?= +shared_verify_targets ?= shared_verify_targets_dirty ?= - -# Extra targets are set by the Makefiles in the project. -extra_generate_targets ?= -extra_verify_targets ?= -extra_verify_targets_dirty ?= diff --git a/make/_shared/generate-verify/02_mod.mk b/make/_shared/generate-verify/02_mod.mk index c5e2a96e..e456e1f4 100644 --- a/make/_shared/generate-verify/02_mod.mk +++ b/make/_shared/generate-verify/02_mod.mk @@ -15,7 +15,7 @@ .PHONY: generate ## Generate all generate targets. ## @category [shared] Generate/ Verify -generate: $(shared_generate_targets) $(extra_generate_targets) +generate: $(shared_generate_targets) verify_script := $(dir $(lastword $(MAKEFILE_LIST)))/util/verify.sh @@ -26,6 +26,6 @@ verify-%: FORCE .PHONY: verify ## Verify code and generate targets. ## @category [shared] Generate/ Verify -verify: $(shared_generate_targets:%=verify-%) $(extra_generate_targets:%=verify-%) $(shared_verify_targets) $(extra_verify_targets) +verify: $(shared_generate_targets:%=verify-%) $(shared_verify_targets) @echo "The following targets create temporary files in the current directory, that is why they have to be run last:" - $(MAKE) noop $(shared_verify_targets_dirty) $(extra_verify_targets_dirty) + $(MAKE) noop $(shared_verify_targets_dirty) diff --git a/make/_shared/kind/00_mod.mk b/make/_shared/kind/00_mod.mk index 42d9c3b1..d271daac 100644 --- a/make/_shared/kind/00_mod.mk +++ b/make/_shared/kind/00_mod.mk @@ -15,7 +15,14 @@ images_amd64 ?= images_arm64 ?= -kind_version := v1.27.3 +kind_k8s_version := v1.29.0 -images_amd64 += docker.io/kindest/node:$(kind_version)@sha256:9dd3392d79af1b084671b05bcf65b21de476256ad1dcc853d9f3b10b4ac52dde -images_arm64 += docker.io/kindest/node:$(kind_version)@sha256:de0b3dfe848ccf07e24f4278eaf93edb857b6231b39773f46b36a2b1a6543ae9 +# Goto https://github.com/kubernetes-sigs/kind/releases/tag/ and find the +# multi-arch digest for the image you want to use. Then use crane to get the platform +# specific digest. For example (digest is the multi-arch digest from the release page): +# digest="sha256:eaa1450915475849a73a9227b8f201df25e55e268e5d619312131292e324d570" +# crane digest --platform=linux/amd64 docker.io/kindest/node@$digest +# crane digest --platform=linux/arm64 docker.io/kindest/node@$digest + +images_amd64 += docker.io/kindest/node:$(kind_k8s_version)@sha256:54a50c9354f11ce0aa56a85d2cacb1b950f85eab3fe1caf988826d1f89bf37eb +images_arm64 += docker.io/kindest/node:$(kind_k8s_version)@sha256:8ccbd8bc4d52c467f3c79eeeb434827c225600a1d7385a4b1c19d9e038c9e0c0 diff --git a/make/_shared/oci-image/01_mod.mk b/make/_shared/oci-image/01_mod.mk index 8085717a..52b2fa9e 100644 --- a/make/_shared/oci-image/01_mod.mk +++ b/make/_shared/oci-image/01_mod.mk @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -oci_platforms := all +oci_platforms := linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details @@ -82,6 +82,7 @@ ARGS ?= # default empty ## Run a controller from your host. ## @category [shared] Build $(run_targets): run-%: | $(NEEDS_GO) + CGO_ENABLED=$(CGO_ENABLED) \ $(GO) run \ -ldflags '$(go_$*_ldflags)' \ $(go_$*_source_path) $(ARGS) @@ -92,7 +93,7 @@ $(run_targets): run-%: | $(NEEDS_GO) $(oci_build_targets): oci-build-%: | $(NEEDS_KO) $(NEEDS_GO) $(NEEDS_YQ) $(bin_dir)/scratch/image $(eval oci_layout_path := $(bin_dir)/scratch/image/oci-layout-$*.$(oci_$*_image_tag)) rm -rf $(CURDIR)/$(oci_layout_path) - + echo '{}' | \ $(YQ) '.defaultBaseImage = "$(oci_$*_base_image)"' | \ $(YQ) '.builds[0].id = "$*"' | \ diff --git a/make/_shared/tools/00_mod.mk b/make/_shared/tools/00_mod.mk index 7651bac9..d36ba0a0 100644 --- a/make/_shared/tools/00_mod.mk +++ b/make/_shared/tools/00_mod.mk @@ -97,6 +97,10 @@ TOOLS += syft=v0.100.0 # https://pkg.go.dev/k8s.io/code-generator/cmd?tab=versions K8S_CODEGEN_VERSION=v0.29.0 +TOOLS += applyconfiguration-gen=$(K8S_CODEGEN_VERSION) +TOOLS += openapi-gen=$(K8S_CODEGEN_VERSION) +TOOLS += defaulter-gen=$(K8S_CODEGEN_VERSION) +TOOLS += conversion-gen=$(K8S_CODEGEN_VERSION) # https://github.com/kubernetes-sigs/kubebuilder/blob/tools-releases/build/cloudbuild_tools.yaml KUBEBUILDER_ASSETS_VERSION=1.28.3 @@ -268,6 +272,10 @@ GO_DEPENDENCIES += oras=oras.land/oras/cmd/oras GO_DEPENDENCIES += klone=github.com/cert-manager/klone GO_DEPENDENCIES += goreleaser=github.com/goreleaser/goreleaser GO_DEPENDENCIES += syft=github.com/anchore/syft/cmd/syft +GO_DEPENDENCIES += applyconfiguration-gen=k8s.io/code-generator/cmd/applyconfiguration-gen +GO_DEPENDENCIES += openapi-gen=k8s.io/code-generator/cmd/openapi-gen +GO_DEPENDENCIES += defaulter-gen=k8s.io/code-generator/cmd/defaulter-gen +GO_DEPENDENCIES += conversion-gen=k8s.io/code-generator/cmd/conversion-gen define go_dependency $$(bin_dir)/downloaded/tools/$1@$($(call UC,$1)_VERSION)_%: | $$(NEEDS_GO) $$(bin_dir)/downloaded/tools @@ -349,24 +357,6 @@ $(bin_dir)/downloaded/tools/azwi@$(AZWI_VERSION)_%: | $(bin_dir)/downloaded/tool tar xfO $@.tar.gz azwi > $@ && chmod 775 $@ rm -f $@.tar.gz -##################### -# k8s codegen tools # -##################### - -K8S_CODEGEN_TOOLS := applyconfiguration-gen openapi-gen -K8S_CODEGEN_TOOLS_PATHS := $(K8S_CODEGEN_TOOLS:%=$(bin_dir)/tools/%) -K8S_CODEGEN_TOOLS_DOWNLOADS := $(K8S_CODEGEN_TOOLS:%=$(bin_dir)/downloaded/tools/%@$(K8S_CODEGEN_VERSION)) - -k8s-codegen-tools: $(K8S_CODEGEN_TOOLS_PATHS) - -$(K8S_CODEGEN_TOOLS_PATHS): $(bin_dir)/tools/%-gen: $(bin_dir)/scratch/K8S_CODEGEN_VERSION | $(bin_dir)/downloaded/tools/%-gen@$(K8S_CODEGEN_VERSION) $(bin_dir)/tools - cd $(dir $@) && $(LN) $(patsubst $(bin_dir)/%,../%,$(word 1,$|)) $(notdir $@) - @touch $@ # making sure the target of the symlink is newer than *_VERSION - -$(K8S_CODEGEN_TOOLS_DOWNLOADS): $(bin_dir)/downloaded/tools/%-gen@$(K8S_CODEGEN_VERSION): $(NEEDS_GO) | $(bin_dir)/downloaded/tools - GOBIN=$(CURDIR)/$(dir $@) $(GO) install k8s.io/code-generator/cmd/$(notdir $@) - @mv $(subst @$(K8S_CODEGEN_VERSION),,$@) $@ - ############################ # kubebuilder-tools assets # # kube-apiserver / etcd # @@ -474,7 +464,7 @@ endif .PHONY: tools ## Download and setup all tools ## @category [shared] Tools -tools: $(TOOLS_PATHS) $(K8S_CODEGEN_TOOLS_PATHS) +tools: $(TOOLS_PATHS) self_file := $(dir $(lastword $(MAKEFILE_LIST)))/00_mod.mk