Fix tag-based manifest pulls 404ing while digest-based pulls succeed#2438
Open
wussh wants to merge 3 commits into
Open
Fix tag-based manifest pulls 404ing while digest-based pulls succeed#2438wussh wants to merge 3 commits into
wussh wants to merge 3 commits into
Conversation
Author
|
Verified this fix end-to-end against the live cluster that originally hit #2417 (Domains + on-demand + follow-latest distribution, S3 storage, pulpcore 3.113.0 / pulp_container 2.28.0):
|
ManifestResponse.from_tag rejected requests based on the client Accept header, raising ManifestNotFound when the tag's manifest media type wasn't explicitly listed. from_manifest (the digest lookup path) never had this check, so identical content served 200 by digest and 404 by tag — most visible with manifest-list/OCI-index tags whose media type clients often omit from Accept. This was introduced in 8479d52 (pulp#1974) when manifest serving moved from a content-app redirect (which ignored Accept) into the registry API view. from_tag now matches from_manifest: it always serves the tagged manifest, only rewriting schema v1 to the signed content type. Fixes pulp#2417
Fixes a ruff UP032 finding introduced by the new test added in this branch.
ruff 0.16.0 (released 2026-07-23) introduced new default lint rules that flag ~200 pre-existing findings across the codebase unrelated to this PR (confirmed: a clean checkout of main also fails with 0.16.0, and passes with 0.15.22). lint_requirements.txt does not pin a version, so CI always installs latest, breaking every PR touched after that release regardless of content. Pinning below 0.16 restores a clean lint run without masking any real issue introduced by this change. This file carries a "managed by plugin_template" banner; a maintainer may want to fold the same pin into the template instead of carrying it here long-term.
wussh
force-pushed
the
fix-2417-tag-manifest-404
branch
from
July 26, 2026 17:11
319a366 to
75a7a9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ManifestResponse.from_tagrejected requests based on the clientAcceptheader, raisingManifestNotFoundwhen the tag's manifest media type wasn't explicitly listed.from_manifest(the digest lookup path) never had this check, so the identical content served200by digest and404by tag — most visible for manifest-list/OCI-index tags whose media type clients often omit fromAccept.8479d527), which moved manifest serving from a content-app redirect (that ignoredAccept) into the registry API view.from_tagnow mirrorsfrom_manifest: it always serves the tagged manifest, only rewriting schema v1 to the signed content type.Fixes #2417
Test plan
test_pull_content.py::test_api_performes_schema_conversion(previously asserted a 4xx with the comment "I don't understand what this is testing") intotest_api_serves_tag_regardless_of_accept_header, which pulls the same manifest by tag and by digest with a narrowAcceptheader and asserts identical200responses.registry_api.pyout of the runningpulp-apipod, applied only thefrom_tagdiff from this PR on top of it (no unrelated version drift), wrote it back into the running container, and reloaded gunicorn workers (no pod restart). Results:404, digest pull200(matches the issue exactly).200, digest pull200,tags/list200, and the tag/digest response bodies are byte-identical.404baseline — no lasting changes were left on the cluster.