Skip to content

Commit d3167c0

Browse files
committed
cmd-copy-container: handle v2s2 manifest lists
We need to support arch peeling even for multi-arch source containers pushed using v2s2. Thankfully, the schema is identical to the OCI schema for our purposes which makes supporting it painless. Related: coreos#2726 (cherry picked from commit cd32708) (cherry picked from commit 459831c)
1 parent 2c5e922 commit d3167c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cmd-copy-container

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ EXAMPLE_USAGE = """examples:
2020
registry.ci.openshift.org/jlebon/fedora-coreos
2121
"""
2222

23-
MEDIA_TYPE_IMAGE_INDEX = 'application/vnd.oci.image.index.v1+json'
23+
MEDIA_TYPE_OCI_IMAGE_INDEX = 'application/vnd.oci.image.index.v1+json'
24+
MEDIA_TYPE_DOCKER_MANIFEST_LIST = 'application/vnd.docker.distribution.manifest.list.v2+json'
2425

2526

2627
def main():
@@ -48,7 +49,8 @@ def main():
4849
copies[f'{args.src_repo}:{tag}'] = f'{args.dest_repo}:{tag}'
4950
else:
5051
inspect = skopeo_inspect(f'{args.src_repo}:{tag}', args.authfile)
51-
if inspect.get('mediaType') != MEDIA_TYPE_IMAGE_INDEX:
52+
if inspect.get('mediaType') not in [MEDIA_TYPE_OCI_IMAGE_INDEX,
53+
MEDIA_TYPE_DOCKER_MANIFEST_LIST]:
5254
# src is not manifest listed, so no arch peeling needed
5355
copies[f'{args.src_repo}:{tag}'] = f'{args.dest_repo}:{tag}'
5456
else:

0 commit comments

Comments
 (0)