Skip to content

Commit

Permalink
Adjusted checks for manifest media types
Browse files Browse the repository at this point in the history
  • Loading branch information
midnightercz committed May 22, 2024
1 parent 90bb001 commit 368ac92
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pubtools/_quay/tag_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ def get_image_details(self, reference: str, executor: Executor) -> Optional[Imag
raise BadPushItem("Image {0} has manifest type different than V2S2 or manifest list")

# Check arch if the image is V2S2 manifest
if manifest["mediaType"] == TagDocker.MANIFEST_V2S2_TYPE:
if manifest["mediaType"] in (
TagDocker.MANIFEST_V2S2_TYPE,
TagDocker.MANIFEST_OCI_V2S2_TYPE,
):
arch = executor.skopeo_inspect(reference)["Architecture"]
# Arch check is not a great way to verify that this is a source image, but there are
# no better options without having build details
Expand Down Expand Up @@ -313,13 +316,19 @@ def tag_remove_calculate_archs(
)

# Scenario 1: source image
if dest_details.manifest_type == TagDocker.MANIFEST_V2S2_TYPE:
if dest_details.manifest_type in (
TagDocker.MANIFEST_V2S2_TYPE,
TagDocker.MANIFEST_OCI_V2S2_TYPE,
):
return self.tag_remove_calculate_archs_source_image(
push_item, source_details, dest_details
)

# Scenario 2: multiarch image
if dest_details.manifest_type == TagDocker.MANIFEST_LIST_TYPE:
if dest_details.manifest_type in (
TagDocker.MANIFEST_LIST_TYPE,
TagDocker.MANIFEST_OCI_LIST_TYPE,
):
return self.tag_remove_calculate_archs_multiarch_image(
push_item, source_details, dest_details
)
Expand Down

0 comments on commit 368ac92

Please sign in to comment.