Skip to content

Commit

Permalink
Support untagging OCI images
Browse files Browse the repository at this point in the history
  • Loading branch information
midnightercz committed May 21, 2024
1 parent 2cd8e69 commit 90bb001
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pubtools/_quay/tag_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class TagDocker:
ImageDetails = namedtuple("ImageDetails", ["reference", "manifest", "manifest_type", "digest"])
MANIFEST_LIST_TYPE = "application/vnd.docker.distribution.manifest.list.v2+json"
MANIFEST_V2S2_TYPE = "application/vnd.docker.distribution.manifest.v2+json"
MANIFEST_OCI_LIST_TYPE = "application/vnd.oci.image.index.v1+json"
MANIFEST_OCI_V2S2_TYPE = "application/vnd.oci.image.manifest.v1+json"

def __init__(
self,
Expand Down Expand Up @@ -220,7 +222,12 @@ def get_image_details(self, reference: str, executor: Executor) -> Optional[Imag
raise

manifest_type = manifest["mediaType"]
if manifest_type not in [TagDocker.MANIFEST_V2S2_TYPE, TagDocker.MANIFEST_LIST_TYPE]:
if manifest_type not in [
TagDocker.MANIFEST_V2S2_TYPE,
TagDocker.MANIFEST_LIST_TYPE,
TagDocker.MANIFEST_OCI_V2S2_TYPE,
TagDocker.MANIFEST_OCI_LIST_TYPE,
]:
raise BadPushItem("Image {0} has manifest type different than V2S2 or manifest list")

# Check arch if the image is V2S2 manifest
Expand Down

0 comments on commit 90bb001

Please sign in to comment.