Skip to content

remote: copy manifest annotations to referrers fallback tag descriptors - #2441

Merged
Subserial merged 1 commit into
google:mainfrom
codysoyland:referrers-fallback-annotations
Sep 4, 2026
Merged

Subserial merged 1 commit into
google:mainfrom
codysoyland:referrers-fallback-annotations

Conversation

@codysoyland

Copy link
Copy Markdown
Contributor

The distribution spec requires that "all annotations from the pushed manifest MUST be copied to this descriptor" when a client maintains the referrers fallback tag, but we only carried mediaType, digest, size, and (since #2269) artifactType. Consumers that filter referrers by annotation (cosign, oras, regctl) can't tell sigstore bundles apart without the dev.sigstore.bundle.* annotations, so they end up pulling every referrer.

This is the write-side counterpart of #2269, which fixed artifactType hoisting in this path and annotations on the read side. Give the fake registry's referrers endpoint the same treatment so both test legs (referrers API and fallback tag) assert identical descriptors.

Related: sigstore/cosign#4641.

Assisted by Claude Code.

@google-cla

google-cla Bot commented Sep 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The distribution spec requires that "all annotations from the pushed
manifest MUST be copied to this descriptor" when a client maintains
the referrers fallback tag, but we only carried mediaType, digest,
size, and (since google#2269) artifactType. Consumers that filter referrers
by annotation (cosign, oras, regctl) can't tell sigstore bundles apart
without the dev.sigstore.bundle.* annotations, so they end up pulling
every referrer.

This is the write-side counterpart of google#2269, which fixed artifactType
hoisting in this path and annotations on the read side. Give the fake
registry's referrers endpoint the same treatment so both test legs
(referrers API and fallback tag) assert identical descriptors.

Reported in sigstore/cosign#4641.

Signed-off-by: Cody Soyland <[email protected]>
@codysoyland
codysoyland force-pushed the referrers-fallback-annotations branch from 8e3ccac to 4968097 Compare September 3, 2026 19:55
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.69%. Comparing base (25c682e) to head (4968097).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2441      +/-   ##
==========================================
+ Coverage   59.62%   59.69%   +0.06%     
==========================================
  Files         167      167              
  Lines       11637    11670      +33     
==========================================
+ Hits         6939     6966      +27     
- Misses       3812     3815       +3     
- Partials      886      889       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Subserial
Subserial merged commit 8a72a42 into google:main Sep 4, 2026
19 checks passed
bobcallaway pushed a commit to sigstore/cosign that referenced this pull request Sep 5, 2026
When pushing a signature or attestation to a registry without the
referrers API, the fallback tag's descriptors were missing the bundle
manifest's annotations (dev.sigstore.bundle.content,
dev.sigstore.bundle.predicateType), so consumers couldn't filter
referrers without pulling each one. Fixed upstream in
google/go-containerregistry#2441, released in v0.22.1.

Note that existing fallback tags written by older releases are not
retroactively repaired: re-signing the same artifact skips the
already-present digest, so a stale index must be deleted and the
referrer re-pushed to pick up the annotations.

Fixes #4641

Signed-off-by: Cody Soyland <[email protected]>
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
crane 0.22.1

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* Reject non-canonical IP literals in all SSRF guards by @shaggyinsomniac in google/go-containerregistry#2426
* daemon: fix stale docker/docker reference in WithClient docs by @BobDu in google/go-containerregistry#2428
* build(deps): bump the go-deps group across 2 directories with 4 updates by @dependabot[bot] in google/go-containerregistry#2422
* authn: do not overwrite AuthConfig.Auth when username and password are empty by @nileshpatil6 in google/go-containerregistry#2420
* build(deps): bump the actions group across 1 directory with 8 updates by @dependabot[bot] in google/go-containerregistry#2423
* Support pulling images by sha512 digest by @BobDu in google/go-containerregistry#2427
* Allow empty label and annotation values in crane mutate by @theadsingh in google/go-containerregistry#2418
* fix(build): Use dependencies.gitSource in cloudbuild_v2.yaml by @tprussak in google/go-containerregistry#2434
* validate: support index attestation manifests and empty configs by @Subserial in google/go-containerregistry#2414
* name: improve error when parsing a reference with a URL scheme by @locker95 in google/go-containerregistry#2431
* fix(build): install binaries to /ko-app and add to PATH (#2424) by @tprussak in google/go-containerregistry#2436
* fix(release): honor declared Go toolchain by @rksharma-owg in google/go-containerregistry#2435
* remote: apply checkRedirectSSRF to writer-side HTTP clients by @locker95 in google/go-containerregistry#2432
* flatten: preserve config and layer media types when flattening by @Subserial in google/go-containerregistry#2438
* fix(mutate): make Time layer updates lazy by @amarkdotdev in google/go-containerregistry#2429
* build(deps): bump the go-deps group across 2 directories with 3 updates by @dependabot[bot] in google/go-containerregistry#2439
* remote: copy manifest annotations to referrers fallback tag descriptors by @codysoyland in google/go-containerregistry#2441

## New Contributors
* @shaggyinsomniac made their first contribution in google/go-containerregistry#2426
* @BobDu made their first contribution in google/go-containerregistry#2428
* @nileshpatil6 made their first contribution in google/go-containerregistry#2420
* @theadsingh made their first contribution in google/go-containerregistry#2418
* @locker95 made their first contribution in google/go-containerregistry#2431
* @rksharma-owg made their first contribution in google/go-containerregistry#2435
* @codysoyland made their first contribution in google/go-containerregistry#2441

**Full Changelog**: https://github.com/google/go-containerregistry/compare/v0.22.0...v0.22.1</pre>
  <p>View the full release notes at <a href="https://github.com/google/go-containerregistry/releases/tag/v0.22.1">https://github.com/google/go-containerregistry/releases/tag/v0.22.1</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!18250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants