From 90bb00101dec1124c19f210905e5e7d7ec39f4d4 Mon Sep 17 00:00:00 2001 From: Jindrich Luza Date: Tue, 21 May 2024 18:34:32 +0200 Subject: [PATCH] Support untagging OCI images --- pubtools/_quay/tag_docker.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pubtools/_quay/tag_docker.py b/pubtools/_quay/tag_docker.py index b518952a..cff5d6c8 100644 --- a/pubtools/_quay/tag_docker.py +++ b/pubtools/_quay/tag_docker.py @@ -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, @@ -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