Skip to content

Commit

Permalink
wip/draft
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hyagi committed Mar 28, 2024
1 parent 5dfe9b0 commit 48ddf40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pulp_container/app/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ async def get_by_digest(self, request):
"""
Return a response to the "GET" action.
"""
#try:
# import debugpy
# debugpy.listen(('0.0.0.0',5678))
# debugpy.wait_for_client()
#except:
# pass
path = request.match_info["path"]
digest = "sha256:{digest}".format(digest=request.match_info["digest"])
distribution = await sync_to_async(self._match_distribution)(path, add_trailing_slash=False)
Expand Down Expand Up @@ -301,7 +307,7 @@ async def get_by_digest(self, request):
blob = await pull_downloader.init_remote_blob()
ca = await blob.contentartifact_set.afirst()
return await self._stream_content_artifact(request, web.StreamResponse(), ca)
elif request.match_info["content"] == "config-blobs":
elif content_type == "config-blobs":
blob = await ConfigBlob.objects.aget(digest=digest)
media_type=MEDIA_TYPE.CONFIG_BLOB ### need to find a better way to identify the media_type
headers = {
Expand Down
2 changes: 1 addition & 1 deletion pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ def get_content_units_to_add(self, manifest, tag):
models.MEDIA_TYPE.MANIFEST_LIST,
models.MEDIA_TYPE.INDEX_OCI,
):
for listed_manifest in manifest.listed_manifests:
for listed_manifest in manifest.listed_manifests.all():
add_content_units.append(listed_manifest.pk)
add_content_units.append(listed_manifest.config_blob_id)
add_content_units.extend(listed_manifest.blobs.values_list("pk", flat=True))
Expand Down

0 comments on commit 48ddf40

Please sign in to comment.