|
17 | 17 | ## request or change is merged.
|
18 | 18 | ##
|
19 | 19 | ## @category CI
|
20 |
| -ci-presubmit: verify-imports verify-errexit verify-boilerplate verify-codegen verify-crds verify-modules |
| 20 | +ci-presubmit: verify-imports verify-errexit verify-boilerplate verify-codegen verify-crds verify-modules verify-helm-docs |
21 | 21 |
|
22 | 22 | .PHONY: verify-golangci-lint
|
23 | 23 | verify-golangci-lint: test/integration/versionchecker/testdata/test_manifests.tar | $(NEEDS_GOLANGCI-LINT)
|
@@ -109,9 +109,23 @@ update-codegen: | k8s-codegen-tools $(NEEDS_GO)
|
109 | 109 | ./$(BINDIR)/tools/conversion-gen \
|
110 | 110 | ./$(BINDIR)/tools/openapi-gen
|
111 | 111 |
|
| 112 | +# inject_helm_docs performs `helm-tool inject` using $1 as the output file and $2 as the values input |
| 113 | +define inject_helm_docs |
| 114 | +$(HELM-TOOL) inject --header-search '^<!-- AUTO-GENERATED -->' --footer-search '^<!-- /AUTO-GENERATED -->' -i $2 -o $1 |
| 115 | +endef |
| 116 | + |
112 | 117 | .PHONY: update-helm-docs
|
113 |
| -update-helm-docs: | $(NEEDS_HELM-TOOL) |
114 |
| - $(HELM-TOOL) inject --header-search '^<!-- AUTO-GENERATED -->' --footer-search '^<!-- /AUTO-GENERATED -->' -i deploy/charts/cert-manager/values.yaml -o deploy/charts/cert-manager/README.template.md |
| 118 | +update-helm-docs: deploy/charts/cert-manager/README.template.md deploy/charts/cert-manager/values.yaml | $(NEEDS_HELM-TOOL) |
| 119 | + $(call inject_helm_docs,deploy/charts/cert-manager/README.template.md,deploy/charts/cert-manager/values.yaml) |
| 120 | + |
| 121 | +.PHONY: verify-helm-docs |
| 122 | +verify-helm-docs: | $(NEEDS_HELM-TOOL) |
| 123 | + @if ! git diff --exit-code -- deploy/charts/cert-manager/README.template.md > /dev/null ; then \ |
| 124 | + echo "\033[0;33mdeploy/charts/cert-manager/README.template.md has been modified and could be out of date; update with 'make update-helm-docs'\033[0m" ; \ |
| 125 | + exit 1 ; \ |
| 126 | + fi |
| 127 | + @cp deploy/charts/cert-manager/README.template.md $(BINDIR)/scratch/LATEST_HELM_README-$(HELM-TOOL_VERSION) && $(call inject_helm_docs,$(BINDIR)/scratch/LATEST_HELM_README-$(HELM-TOOL_VERSION),deploy/charts/cert-manager/values.yaml) |
| 128 | + @diff $(BINDIR)/scratch/LATEST_HELM_README-$(HELM-TOOL_VERSION) deploy/charts/cert-manager/README.template.md || (echo -e "\033[0;33mdeploy/charts/cert-manager/README.template.md seems to be out of date; update with 'make update-helm-docs'\033[0m" && exit 1) |
115 | 129 |
|
116 | 130 | .PHONY: update-all
|
117 | 131 | ## Update CRDs, code generation and licenses to the latest versions.
|
|
0 commit comments