Skip to content

Publish the Helm chart to the OCI registry from the publish pipeline - #377

Merged
cert-manager-prow[bot] merged 2 commits into
cert-manager:masterfrom
wallrj:oci-chart-publish
Nov 25, 2026
Merged

cert-manager-prow[bot] merged 2 commits into
cert-manager:masterfrom
wallrj:oci-chart-publish

Conversation

@wallrj

@wallrj wallrj commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

This revives #290 by @SgtCoDFish. cmrel publish now pushes and signs the Helm chart in quay.io/jetstack/charts, which we do by hand today with hack/push_and_sign_chart.sh.

What changes

  • New helmchartoci publish action. It pushes the chart and its .prov file, signs and verifies the tag with cosign, then copies the chart to the tag without the v prefix and signs that too.
  • The helmchartpr action is removed. We wanted to stop opening chart PRs from cmrel, and the publish token can no longer reach jetstack/jetstack-charts. charts.jetstack.io will sync from the OCI registry instead.
  • Publish actions run in a fixed order, with the chart last, because the chart references the container images.
  • cosign v1.13.6 becomes v2.6.5. New flags keep the v1 behaviour: nothing is uploaded to the transparency log. cosign v3 cannot sign with our KMS key yet.
  • helm v4.3.1 and crane v0.22.1 are installed with go install from pinned tags, as cmrel and cosign already are.
  • make test runs go test ./.... This needed a fix for a panic in CmctlIsShipped on an invalid version.

What I checked

charts.jetstack.io does not list v1.22.0-alpha.0 yet. That depends on jetstack/jetstack-charts#560, not on this PR.

Why each change is needed
  • helmchartpr: we rotated the publish GitHub token to the cert-manager-bot account during Release cert-manager v1.21.2 cert-manager#9237. That token cannot reach jetstack/jetstack-charts, so the action cannot run. We had planned to remove it anyway, so that charts.jetstack.io follows the OCI registry and a release needs no PR in a private repository. The GitHub repository manager, its flags, the Cloud Build substitutions and the gcb/test/helm job are removed with it.
  • cosign flags: every cosign sign call passes --tlog-upload=false --new-bundle-format=false --use-signing-config=false. cosign verify-blob passes --insecure-ignore-tlog=true. On v2.6.5 only --tlog-upload=false and --insecure-ignore-tlog=true change the defaults. The other two are already the v2 defaults. We pass them so that a later move to v3 keeps the same behaviour.
  • cosign v2, not v3: v3.1.3 fails with unexpected length of digest for hash function specified when it signs with our SHA-512 KMS key. v2.6.5 still has the older signing code, which hashes with the key's own algorithm.
  • Pinned helm: Add OCI signing as part of existing publish pipeline #290 piped an unpinned script from helm's main branch into sh. The publish job has KMS signing access, so its tools must come from pinned sources.
  • Tool versions: cosign and crane match modules/tools/00_mod.mk in makefile-modules. helm is v4.3.1, the version the alpha was published with. makefile-modules has since moved to v4.3.2.
  • Tests: the new tests use testify, which is new as a direct dependency. It was already in go.sum.
Evidence
Follow-ups, not in this PR

Closes #290.

[Claude Fable 5.2]

@cert-manager-prow

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@cert-manager-prow cert-manager-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 11, 2026
@cert-manager-prow cert-manager-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 25, 2026
@cert-manager-prow cert-manager-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 5, 2026
@wallrj
wallrj marked this pull request as ready for review November 5, 2026 14:37
@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 5, 2026
@wallrj
wallrj requested a balanced review from Copilot November 5, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The publishing flow skips the compatibility tag when signing is disabled and can expose the OCI chart before its images are available, leaving releases incomplete or temporarily unusable.

2 open issues
What changed in this PR

This PR moves Helm chart publication into cmrel’s publish pipeline, replacing chart-repository pull requests with OCI uploads, signing, verification, and compatibility tags.

Changes:

  • Adds helmchartoci and removes the obsolete helmchartpr implementation and integration fixtures.
  • Pins Helm and crane installations and upgrades cosign with flags preserving existing signing behavior.
  • Adds command-runner tests and prevents panics on invalid release versions.
File Description
pkg/​sign/​cosign/​cosign.go Adds configurable signing and verification with legacy-compatible defaults.
pkg/​sign/​cosign/​cosign_test.go Tests arguments, runner invocation, and error propagation.
pkg/​shell/​shell.go Adds an injectable command runner.
pkg/​release/​validation/​validate.go Rejects empty versions without panicking.
pkg/​release/​platforms.go Handles malformed versions safely.
pkg/​release/​platforms_test.go Covers invalid version inputs.
pkg/​release/​manifests/​chart.go Exposes chart names for OCI references.
pkg/​release/​helm/​testdata/​README.md Removes obsolete fixture instructions.
pkg/​release/​helm/​testdata/​cert-manager/​values.yaml Removes obsolete chart values.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​tests/​test-connection.yaml Removes the connection-test fixture.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​serviceaccount.yaml Removes the service-account fixture.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​service.yaml Removes the service fixture.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​NOTES.txt Removes fixture installation notes.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​ingress.yaml Removes the ingress fixture.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​hpa.yaml Removes the autoscaling fixture.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​deployment.yaml Removes the deployment fixture.
pkg/​release/​helm/​testdata/​cert-manager/​templates/​_helpers.tpl Removes fixture template helpers.
pkg/​release/​helm/​testdata/​cert-manager/​Chart.yaml Removes obsolete chart metadata.
pkg/​release/​helm/​testdata/​cert-manager/​.helmignore Removes fixture packaging exclusions.
pkg/​release/​helm/​oci.go Adds Helm push and crane tag-copy helpers.
pkg/​release/​helm/​oci_test.go Tests OCI helper invocations and errors.
pkg/​release/​helm/​helm.go Removes GitHub chart-repository management.
pkg/​release/​helm/​helm_test.go Removes the chart-PR integration test.
pkg/​release/​helm/​github_client.go Removes chart-specific GitHub interfaces.
pkg/​release/​consts.go Removes chart-repository defaults.
go.mod Removes the direct testify dependency.
gcb/​test/​helm/​README.md Removes obsolete integration-job documentation.
gcb/​test/​helm/​cloudbuild.yaml Removes the chart-PR integration job.
gcb/​publish/​cloudbuild.yaml Installs pinned tools and passes OCI settings.
cmd/​cmrel/​cmd/​publish.go Replaces chart GitHub settings with the OCI registry option.
cmd/​cmrel/​cmd/​gcb_publish.go Implements OCI chart publishing and updates image signing.
cmd/​cmrel/​cmd/​gcb_publish_oci_test.go Tests chart publishing sequences and failure handling.
cmd/​cmrel/​cmd/​const.go Defines the default chart OCI registry.

Review effort: Balanced


var publishActionMap map[string]publishAction = map[string]publishAction{
"helmchartpr": pushHelmChartPR,
"helmchartoci": pushHelmChartOCI,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Actions now run in a fixed order: githubrelease, pushcontainerimages, helmchartoci. The chart is published after the images it references. Subset selection and -action removal still work, and TestPublishActionListOrder covers it. Fixed in ffb2ae9.

[Claude Fable 5.1]

Comment thread cmd/cmrel/cmd/gcb_publish.go Outdated
Comment on lines +509 to +511
if o.SkipSigning {
log.Printf("Skipping signing for chart %q as skip-signing is set", chart.Name())
continue

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The push and the crane copy now always run. Only the cosign sign and verify calls are gated on --skip-signing. TestPushHelmChartOCI_SkipSigning now expects the crane copy. Fixed in ffb2ae9.

[Claude Fable 5.1]

Add a helmchartoci publish action. It pushes the chart and its .prov
file to quay.io/jetstack/charts, signs and verifies the tag with
cosign, then copies the chart to the tag without the "v" prefix and
signs that too. We do this by hand today with
hack/push_and_sign_chart.sh.

Remove the helmchartpr action. The publish token can no longer reach
jetstack/jetstack-charts, and charts.jetstack.io now syncs from the
OCI registry.

Run the publish actions in a fixed order, with the chart last, because
the chart references the container images.

Move cosign from v1.13.6 to v3.1.3. Pass flags that keep the v1
behaviour, where nothing is uploaded to the transparency log.

Install helm v4.3.1 and crane v0.22.1 with go install from pinned
tags, as we already do for cmrel and cosign.

Run go test ./... in make test. This needed a fix for a panic in
CmctlIsShipped when the version is not valid.

This is based on cert-manager#290 by Ashley Davis.

Co-authored-by: Ashley Davis <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
@wallrj-cyberark

Copy link
Copy Markdown
Member

helmchartoci worked in the v1.22.0-alpha.0 release, but cosign v3.1.3 cannot sign images with our KMS key. The release used cosign v2.6.5 instead. Please change the pin in this PR to match before it merges.

  • cosign v3.1.3 broke image signing. The first real publish pushed the images and then failed to sign them: signing bundle: error signing bundle: unexpected length of digest for hash function specified. v3 gets a SHA-256 signer for KMS keys (kms.Get(ctx, keyRef, crypto.SHA256) in pkg/signature/keys.go), but always signs through sigstore-go's bundle code. That code hashes with the key's own algorithm, which is SHA-512 for our key. --new-bundle-format=false does not avoid this in v3. The dry run did not catch it, because it only runs verify-blob.
  • cosign v2.6.5 works. It still has the legacy signing path, where the GCP KMS signer hashes with the key's algorithm. It accepts every flag cmrel passes. The fix is the top commit on v1.22.0-alpha.0-cmrel (d17b897): cosign/v2/cmd/[email protected] in gcb/publish/cloudbuild.yaml.
  • The chart is published and signed on both tags. Checked from outside the pipeline, see below.

We tested this stacked with #376 and #431, so this shows the three work together.

Evidence: the chart in quay.io

crane manifest on both quay.io/jetstack/charts/cert-manager:v1.22.0-alpha.0 and :1.22.0-alpha.0 (same digest, sha256:e950f7c9…) shows:

application/vnd.cncf.helm.config.v1+json
application/vnd.cncf.helm.chart.content.v1.tar+gzip
application/vnd.cncf.helm.chart.provenance.v1.prov

cosign verify --key cert-manager-pubkey-2021-09-20.pem --signature-digest-algorithm sha512 --insecure-ignore-tlog=true passes on both tags, on all five image manifest lists, and on a per-arch image (cert-manager-controller-arm64).

helm pull oci://quay.io/jetstack/charts/cert-manager --version v1.22.0-alpha.0 --verify passes with the published keyring (fingerprint 1020CF3C033D4F35BAE1C19E1226061C665DF13E).

The chart installs on kind from OCI. cmctl version detects v1.22.0-alpha.0, cmctl check api passes, and a self-signed Certificate becomes Ready.

Evidence: the publish log
Pushing chart "cert-manager" to oci://quay.io/jetstack/charts
Pushed: quay.io/jetstack/charts/cert-manager:v1.22.0-alpha.0
Signing chart quay.io/jetstack/charts/cert-manager:v1.22.0-alpha.0 with cosign
Verifying chart signature for quay.io/jetstack/charts/cert-manager:v1.22.0-alpha.0
  - The signatures were verified against the specified public key
Copying chart "cert-manager" to non-v-prefixed version: quay.io/jetstack/charts/cert-manager:1.22.0-alpha.0
Signing chart quay.io/jetstack/charts/cert-manager:1.22.0-alpha.0 with cosign
  - The signatures were verified against the specified public key
Successfully pushed 1 Helm chart(s) to OCI registry

The dry run also showed the cosign verify-blob change working: Verified staged metadata.json signature against KMS key.

What this release did not test
  • The publish ran twice: once with every action (it failed at image signing, after githubrelease), then with --publish-actions pushcontainerimages,helmchartoci. So helmchartoci has only run on a first push, not as a rerun over an existing chart.
  • I have not yet checked that the hourly charts.jetstack.io sync picked up the alpha. I will add that here.
  • Moving to cosign v3 needs a cosign fix, or a move to --signing-config, before it can sign with a SHA-512 KMS key.

[with Claude]

- cosign v3.1.3 fails to sign images with our SHA-512 KMS key:
  "unexpected length of digest for hash function specified".
  It gets a SHA-256 KMS signer (pkg/signature/keys.go) but signs
  through sigstore-go's bundle code, which hashes with the key's
  own algorithm. --new-bundle-format=false does not avoid that
  path in v3.
- cosign v2.6.5 still uses the legacy path, where the GCP KMS
  signer hashes with the key's algorithm, and it accepts every
  flag cmrel passes.

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
@wallrj

wallrj commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

The cosign pin is now v2.6.5. I cherry-picked d17b897 from v1.22.0-alpha.0-cmrel as c5f3611, on top of the commit the alpha was published from, and updated the description to match.

charts.jetstack.io does not list v1.22.0-alpha.0 yet, although it lists the v1.21 pre-releases. That needs jetstack/jetstack-charts#560 and does not block this PR.

[Claude Fable 5.2]

@wallrj-cyberark

Copy link
Copy Markdown
Member

The hourly charts.jetstack.io sync picked up the chart from quay.io. At 17:02 it opened jetstack/jetstack-charts#579 with cert-manager-v1.22.0-alpha.0.tgz, its .prov and the index.yaml entry. The chart on its preview site is byte-identical to the OCI chart, and passes helm pull --verify. It appears on charts.jetstack.io once #579 is merged, which still needs a human approval.

[with Claude]

@SgtCoDFish SgtCoDFish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

The nature of cmrel is that it proves itself by being used. I don't see much value in a forensic review here, and I haven't done one - I checked for anything obviously hugely wrong, didn't find anything and so I'm happy to merge / look into followups!

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SgtCoDFish

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2026
@cert-manager-prow
cert-manager-prow Bot merged commit 67d0a54 into cert-manager:master Nov 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants