Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1974.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manifest data is now served directly from the registry API instead of issuing a redirect to the content app.
3 changes: 1 addition & 2 deletions pulp_container/app/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
app.add_routes(
[
web.get(
PREFIX + r"{path:.+}/{content:(blobs|manifests)}/sha256:{digest:.+}",
PREFIX + r"{path:.+}/blobs/sha256:{digest:.+}",
registry.get_by_digest,
)
]
)
app.add_routes([web.get(PREFIX + r"{path:.+}/manifests/{tag_name}", registry.get_tag)])
23 changes: 1 addition & 22 deletions pulp_container/app/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import redirect

from pulp_container.app.exceptions import ManifestNotFound
from pulp_container.app.utils import get_accepted_media_types
from pulp_container.constants import BLOB_CONTENT_TYPE, MEDIA_TYPE
from pulp_container.constants import BLOB_CONTENT_TYPE


class CommonRedirects:
Expand Down Expand Up @@ -39,25 +37,6 @@ def redirect_to_content_app(self, content_type, content_id):
)
)

def issue_manifest_redirect(self, manifest):
"""
Issue a redirect for the passed manifest.
"""
return self.redirect_to_content_app("manifests", manifest.digest)

def issue_tag_redirect(self, tag):
"""
Issue a redirect for the passed tag.
"""
manifest_media_type = tag.tagged_manifest.media_type
if (
manifest_media_type not in get_accepted_media_types(self.request.headers)
and manifest_media_type != MEDIA_TYPE.MANIFEST_V1
):
raise ManifestNotFound(reference=tag.name)

return self.redirect_to_content_app("manifests", tag.name)


class FileStorageRedirects(CommonRedirects):
"""
Expand Down
Loading
Loading