release: publish trust-manager.crds.yaml as a GitHub Release artifact#948
release: publish trust-manager.crds.yaml as a GitHub Release artifact#948Sanil2108 wants to merge 1 commit into
Conversation
Adds a new \`render-crds\` make target (in make/release-crds.mk) that renders the bundle CRD via \`helm template\` against deploy/charts/trust-manager and strips the Helm-runtime-only labels (\`app.kubernetes.io/managed-by\`, \`helm.sh/chart\`) plus the \`helm.sh/resource-policy: keep\` annotation (via crds.keep=false). The result is dropped at \`_bin/scratch/trust-manager.crds.yaml\` — the same shape cert-manager ships as \`cert-manager.crds.yaml\`. The release workflow now: 1. Runs \`render-crds\` as part of \`make release\` (added to the existing release target alongside the OCI/Helm pushes). 2. Uploads the rendered file from the build_and_push job as a workflow artifact. 3. Downloads the artifact in the github_release job and attaches it to the draft GitHub Release via \`gh release create ... <file>\`. This unblocks the workflow described in cert-manager#142 — consumers (umbrella charts, GitOps tooling, cdk8s import pipelines) can now pin trust-manager's CRD by GitHub release tag without parsing the Helm chart out-of-band. Fixes cert-manager#142 Signed-off-by: Sanil2108 <sanilkhurana7@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Sanil2108. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi @erikgb — just checking in on this one. It's been about three weeks since I opened the PR and I wanted to make sure I haven't missed any feedback. Happy to make changes if anything needs adjusting. Thanks! |
|
@Sanil2108, thanks for the ping! This PR appears like an AI-generated PR. 🤠 Please confirm that you personally understand all the proposed changes and describe how you have tested the changes. Some of it will need to be tested when performing a release. I can cut an alpha release to test this after the PR is merged. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
Fixes #142. Adds a new `render-crds` make target that produces a stand-alone `trust-manager.crds.yaml` and attaches it to each draft GitHub Release — same convenience cert-manager itself ships as `cert-manager.crds.yaml`.
What changed
`make/release-crds.mk` (new)
```make
$(crds_release_artifact): $ (helm_chart_archive) | $(NEEDS_HELM) $ (NEEDS_YQ) $(bin_dir)/scratch
$(HELM) template trust-manager $ (helm_chart_archive) \
--set crds.enabled=true \
--set crds.keep=false \
--show-only templates/crd-trust.cert-manager.io_bundles.yaml \
--no-hooks \
| $(YQ) 'del(.metadata.labels."app.kubernetes.io/managed-by", .metadata.labels."helm.sh/chart")' \
> $@
```
Rendering against `$(helm_chart_archive)` (the packaged tarball) rather than `$(helm_chart_source_dir)` is deliberate — `helm package --app-version` rewrites the chart's version, so the rendered CRD picks up the actual release tag in its `app.kubernetes.io/version` label. Templating against the source dir directly would ship a CRD labelled `v0.0.0`.
The yq filter strips the Helm-runtime-only labels (`app.kubernetes.io/managed-by`, `helm.sh/chart`) and `crds.keep=false` removes the `helm.sh/resource-policy: keep` annotation, so the artifact is suitable for plain `kubectl apply`.
`make/02_mod.mk`
Includes the new file and runs `render-crds` as the last step of `make release`. Echoes `RELEASE_CRDS_ARTIFACT=$(crds_release_artifact)` to `$GITHUB_OUTPUT` so the workflow can find it.
`.github/workflows/release.yaml`
The `build_and_push` job uploads `_bin/scratch/trust-manager.crds.yaml` as a workflow artifact (pinned `actions/upload-artifact@v7.0.1` SHA, matching the repo's existing SHA-pinning convention). The `github_release` job downloads it and passes it as a positional file argument to `gh release create` so it's attached to the draft release.
Test plan
Notes
Fixes #142