diff --git a/pulp_container/app/registry.py b/pulp_container/app/registry.py index d7532a8ba..9fa4db573 100644 --- a/pulp_container/app/registry.py +++ b/pulp_container/app/registry.py @@ -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) @@ -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 = { diff --git a/pulp_container/app/registry_api.py b/pulp_container/app/registry_api.py index ce8675fa1..e3f906da9 100644 --- a/pulp_container/app/registry_api.py +++ b/pulp_container/app/registry_api.py @@ -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))