Skip to content

Commit

Permalink
Fixed Renderer to handle properly Manifest and Blob responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
ipanova committed Nov 3, 2020
1 parent c01a669 commit 970e2cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES/7620.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed Renderer to handle properly Manifest and Blob responses.
10 changes: 6 additions & 4 deletions pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def __init__(self, reference):
)


class ManifestRenderer(BaseRenderer):
class ContentRenderer(BaseRenderer):
"""
Rendered class for rendering Manifest responses.
Rendered class for rendering Manifest and Blob responses.
"""

media_type = "*/*"
Expand Down Expand Up @@ -504,6 +504,8 @@ class Blobs(RedirectsMixin, ContainerRegistryApiMixin, ViewSet):
ViewSet for interacting with Blobs
"""

renderer_classes = [ContentRenderer]

def head(self, request, path, pk=None):
"""
Responds to HEAD requests about blobs
Expand All @@ -529,10 +531,10 @@ def get(self, request, path, pk=None):

class Manifests(RedirectsMixin, ContainerRegistryApiMixin, ViewSet):
"""
ViewSet for intereacting with Manifests
ViewSet for interacting with Manifests
"""

renderer_classes = [ManifestRenderer]
renderer_classes = [ContentRenderer]
# The lookup regex does not allow /, ^, &, *, %, !, ~, @, #, +, =, ?
lookup_value_regex = "[^/^&*%!~@#+=?]+"

Expand Down
1 change: 0 additions & 1 deletion pulp_container/app/tasks/sync_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ def create_blob(self, man_dc, blob_data):
url=blob_url,
relative_path=digest,
remote=self.remote,
extra_data={"headers": V2_ACCEPT_HEADERS},
deferred_download=self.deferred_download,
)
blob_dc = DeclarativeContent(content=blob, d_artifacts=[da])
Expand Down

0 comments on commit 970e2cf

Please sign in to comment.