Skip to content

Commit

Permalink
Merge pull request #504 from cert-manager/self-upgrade-main
Browse files Browse the repository at this point in the history
[CI] Merge self-upgrade-main into main
  • Loading branch information
cert-manager-prow[bot] authored Dec 11, 2024
2 parents d739fb2 + b276322 commit 5644c79
Show file tree
Hide file tree
Showing 7 changed files with 484 additions and 38 deletions.
8 changes: 8 additions & 0 deletions deploy/crds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CRDs source directory

> **WARNING**: if you are an end-user, you probably should NOT need to use the
> files in this directory. These files are for **reference, development and testing purposes only**.
This directory contains 'source code' used to build our CustomResourceDefinition
resources consumed by our officially supported deployment methods (e.g. the Helm chart).
The CRDs in this directory might be incomplete, and should **NOT** be used to provision the operator.
441 changes: 441 additions & 0 deletions deploy/crds/trust.cert-manager.io_bundles.yaml

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions klone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,65 @@ targets:
- folder_name: boilerplate
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/boilerplate
- folder_name: cert-manager
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/cert-manager
- folder_name: controller-gen
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/controller-gen
- folder_name: generate-verify
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/generate-verify
- folder_name: go
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/go
- folder_name: helm
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/helm
- folder_name: help
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/help
- folder_name: kind
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/kind
- folder_name: klone
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/klone
- folder_name: oci-build
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/oci-build
- folder_name: oci-publish
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/oci-publish
- folder_name: repository-base
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/repository-base
- folder_name: tools
repo_url: https://github.com/cert-manager/makefile-modules.git
repo_ref: main
repo_hash: f8e889062c304340007ecddc9b089ab8ded26633
repo_hash: 6eccdeac5eab23905699243209e0f81afad6f081
repo_path: modules/tools
23 changes: 14 additions & 9 deletions make/_shared/helm/crds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,34 @@ ifeq ($(HOST_OS),darwin)
sed_inplace := sed -i ''
endif

crds_dir ?= deploy/crds
crds_dir_readme := $(dir $(lastword $(MAKEFILE_LIST)))/crds_dir.README.md

$(crds_dir):
mkdir -p $@

$(crds_dir)/README.md: $(crds_dir_readme) | $(crds_dir)
cp $< $@

.PHONY: generate-crds
## Generate CRD manifests.
## @category [shared] Generate/ Verify
generate-crds: | $(NEEDS_CONTROLLER-GEN) $(NEEDS_YQ)
$(eval crds_gen_temp := $(bin_dir)/scratch/crds)
generate-crds: | $(crds_dir)/README.md $(NEEDS_CONTROLLER-GEN) $(NEEDS_YQ)
$(eval directories := $(shell ls -d */ | grep -v -e 'make' $(shell git check-ignore -- * | sed 's/^/-e /')))

rm -rf $(crds_gen_temp)
mkdir -p $(crds_gen_temp)

$(CONTROLLER-GEN) crd \
$(directories:%=paths=./%...) \
output:crd:artifacts:config=$(crds_gen_temp)
output:crd:artifacts:config=$(crds_dir)

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

@for i in $$(ls $(crds_gen_temp)); do \
crd_name=$$($(YQ) eval '.metadata.name' $(crds_gen_temp)/$$i); \
@for i in $$(basename $(crds_dir)/*.yaml); do \
crd_name=$$($(YQ) eval '.metadata.name' $(crds_dir)/$$i); \
cat $(crd_template_header) > $(helm_chart_source_dir)/templates/crd-$$i; \
echo "" >> $(helm_chart_source_dir)/templates/crd-$$i; \
$(sed_inplace) "s/REPLACE_CRD_NAME/$$crd_name/g" $(helm_chart_source_dir)/templates/crd-$$i; \
$(sed_inplace) "s/REPLACE_LABELS_TEMPLATE/$(helm_labels_template_name)/g" $(helm_chart_source_dir)/templates/crd-$$i; \
$(YQ) -I2 '{"spec": .spec}' $(crds_gen_temp)/$$i >> $(helm_chart_source_dir)/templates/crd-$$i; \
$(YQ) -I2 '{"spec": .spec}' $(crds_dir)/$$i >> $(helm_chart_source_dir)/templates/crd-$$i; \
cat $(crd_template_footer) >> $(helm_chart_source_dir)/templates/crd-$$i; \
done

Expand Down
8 changes: 8 additions & 0 deletions make/_shared/helm/crds_dir.README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# CRDs source directory

> **WARNING**: if you are an end-user, you probably should NOT need to use the
> files in this directory. These files are for **reference, development and testing purposes only**.
This directory contains 'source code' used to build our CustomResourceDefinition
resources consumed by our officially supported deployment methods (e.g. the Helm chart).
The CRDs in this directory might be incomplete, and should **NOT** be used to provision the operator.
13 changes: 0 additions & 13 deletions make/_shared/helm/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ $(helm_chart_archive): $(helm_chart_sources) | $(NEEDS_HELM) $(NEEDS_YQ) $(bin_d
## @category [shared] Helm Chart
helm-chart: $(helm_chart_archive)

ifdef helm_docs_use_helm_tool

helm_tool_header_search ?= ^<!-- AUTO-GENERATED -->
helm_tool_footer_search ?= ^<!-- /AUTO-GENERATED -->

Expand All @@ -83,35 +81,24 @@ helm_tool_footer_search ?= ^<!-- /AUTO-GENERATED -->
## @category [shared] Generate/ Verify
generate-helm-docs: | $(NEEDS_HELM-TOOL)
$(HELM-TOOL) inject -i $(helm_chart_source_dir)/values.yaml -o $(helm_chart_source_dir)/README.md --header-search "$(helm_tool_header_search)" --footer-search "$(helm_tool_footer_search)"
else
.PHONY: generate-helm-docs
## Generate Helm chart documentation.
## @category [shared] Generate/ Verify
generate-helm-docs: | $(NEEDS_HELM-DOCS)
$(HELM-DOCS) $(helm_chart_source_dir)/
endif

shared_generate_targets += generate-helm-docs

ifdef helm_generate_schema
.PHONY: generate-helm-schema
## Generate Helm chart schema.
## @category [shared] Generate/ Verify
generate-helm-schema: | $(NEEDS_HELM-TOOL) $(NEEDS_GOJQ)
$(HELM-TOOL) schema -i $(helm_chart_source_dir)/values.yaml | $(GOJQ) > $(helm_chart_source_dir)/values.schema.json

shared_generate_targets += generate-helm-schema
endif

ifdef helm_verify_values
.PHONY: verify-helm-values
## Verify Helm chart values using helm-tool.
## @category [shared] Generate/ Verify
verify-helm-values: | $(NEEDS_HELM-TOOL) $(NEEDS_GOJQ)
$(HELM-TOOL) lint -i $(helm_chart_source_dir)/values.yaml -d $(helm_chart_source_dir)/templates -e $(helm_chart_source_dir)/values.linter.exceptions

shared_verify_targets += verify-helm-values
endif

.PHONY: verify-pod-security-standards
## Verify that the Helm chart complies with the pod security standards.
Expand Down
3 changes: 0 additions & 3 deletions make/_shared/tools/00_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ tools += gojq=v0.12.16
tools += crane=v0.20.2
# https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go?tab=versions
tools += protoc-gen-go=v1.34.2
# https://pkg.go.dev/github.com/norwoodj/helm-docs/cmd/helm-docs?tab=versions
tools += helm-docs=v1.14.2
# https://pkg.go.dev/github.com/sigstore/cosign/v2/cmd/cosign?tab=versions
tools += cosign=v2.4.0
# https://pkg.go.dev/github.com/cert-manager/boilersuite?tab=versions
Expand Down Expand Up @@ -324,7 +322,6 @@ go_dependencies += kustomize=sigs.k8s.io/kustomize/kustomize/v4
go_dependencies += gojq=github.com/itchyny/gojq/cmd/gojq
go_dependencies += crane=github.com/google/go-containerregistry/cmd/crane
go_dependencies += protoc-gen-go=google.golang.org/protobuf/cmd/protoc-gen-go
go_dependencies += helm-docs=github.com/norwoodj/helm-docs/cmd/helm-docs
go_dependencies += cosign=github.com/sigstore/cosign/v2/cmd/cosign
go_dependencies += boilersuite=github.com/cert-manager/boilersuite
go_dependencies += gomarkdoc=github.com/princjef/gomarkdoc/cmd/gomarkdoc
Expand Down

0 comments on commit 5644c79

Please sign in to comment.