Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #1293/2bc57304 backport][2.14] Taught registry to sync/upload oci index that contains docker sub-man… #1461

Merged
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/1231.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Taught the Container Registry to accept docker schema2 sub-manifest types in OCI index.
2 changes: 2 additions & 0 deletions pulp_container/app/json_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def get_descriptor_schema(
allowed_media_types=[
MEDIA_TYPE.MANIFEST_OCI,
MEDIA_TYPE.INDEX_OCI,
MEDIA_TYPE.MANIFEST_V2,
MEDIA_TYPE.MANIFEST_LIST,
],
additional_properties={
"platform": {
Expand Down
7 changes: 4 additions & 3 deletions pulp_container/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,10 @@ def determine_media_type_from_json(content_data):
return media_type
elif manifests := content_data.get("manifests"):
if len(manifests):
if manifests[0].get("mediaType") in (MEDIA_TYPE.MANIFEST_V2, MEDIA_TYPE.MANIFEST_V1):
return MEDIA_TYPE.MANIFEST_LIST
elif manifests[0].get("mediaType") in (MEDIA_TYPE.MANIFEST_OCI, MEDIA_TYPE.INDEX_OCI):
# check if there is at least one oci manifest
if set([m["mediaType"] for m in manifests]).intersection(
(MEDIA_TYPE.MANIFEST_OCI, MEDIA_TYPE.INDEX_OCI)
):
return MEDIA_TYPE.INDEX_OCI
return MEDIA_TYPE.MANIFEST_LIST
else:
Expand Down
Loading