From d9ee026fa71ea1b6538b25ccaf63f120c88fd273 Mon Sep 17 00:00:00 2001 From: git-hyagi <45576767+git-hyagi@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:29:45 -0300 Subject: [PATCH] Fix a sync error with manifests without mediaType fixes: #1746 --- CHANGES/1746.bugfix | 2 ++ pulp_container/app/tasks/sync_stages.py | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 CHANGES/1746.bugfix diff --git a/CHANGES/1746.bugfix b/CHANGES/1746.bugfix new file mode 100644 index 000000000..4c2d7f70e --- /dev/null +++ b/CHANGES/1746.bugfix @@ -0,0 +1,2 @@ +Resolved an issue with syncing content causing errors when retrieving manifests without a mediaType +definition. diff --git a/pulp_container/app/tasks/sync_stages.py b/pulp_container/app/tasks/sync_stages.py index ef7ec4c9f..4660fea95 100644 --- a/pulp_container/app/tasks/sync_stages.py +++ b/pulp_container/app/tasks/sync_stages.py @@ -426,11 +426,9 @@ async def _download_and_instantiate_manifest(self, manifest_url, digest): manifest = Manifest( digest=digest, schema_version=( - 2 - if content_data["mediaType"] in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI) - else 1 + 2 if media_type in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_OCI) else 1 ), - media_type=content_data["mediaType"], + media_type=media_type, data=raw_text_data, annotations=content_data.get("annotations", {}), )