Fix bug around pushing manifest lists that refer to the same manifest twice as children
This commit is contained in:
parent
45db1d27e7
commit
54904cfd6e
3 changed files with 115 additions and 3 deletions
|
@ -1493,3 +1493,41 @@ def test_push_pull_manifest_list_missing_manifest(v22_protocol, basic_images, li
|
|||
[], blobs,
|
||||
credentials=credentials, options=options,
|
||||
expected_failure=Failures.INVALID_MANIFEST)
|
||||
|
||||
|
||||
def test_push_pull_manifest_list_again(v22_protocol, basic_images, different_images,
|
||||
liveserver_session, app_reloader, data_model):
|
||||
""" Test: Push a new tag with a manifest list containing two manifests, push it again, and pull
|
||||
it.
|
||||
"""
|
||||
if data_model != 'oci_model':
|
||||
return
|
||||
|
||||
credentials = ('devtable', 'password')
|
||||
options = ProtocolOptions()
|
||||
|
||||
# Build the manifests that will go in the list.
|
||||
blobs = {}
|
||||
|
||||
first_manifest = v22_protocol.build_schema2(basic_images, blobs, options)
|
||||
second_manifest = v22_protocol.build_schema2(different_images, blobs, options)
|
||||
|
||||
# Create and push the manifest list.
|
||||
builder = DockerSchema2ManifestListBuilder()
|
||||
builder.add_manifest(first_manifest, 'amd64', 'linux')
|
||||
builder.add_manifest(second_manifest, 'arm', 'linux')
|
||||
manifestlist = builder.build()
|
||||
|
||||
v22_protocol.push_list(liveserver_session, 'devtable', 'newrepo', 'latest', manifestlist,
|
||||
[first_manifest, second_manifest], blobs,
|
||||
credentials=credentials, options=options)
|
||||
|
||||
# Push the manifest list again. This should more or less no-op.
|
||||
options.skip_head_checks = True
|
||||
v22_protocol.push_list(liveserver_session, 'devtable', 'newrepo', 'latest', manifestlist,
|
||||
[first_manifest, second_manifest], blobs,
|
||||
credentials=credentials, options=options)
|
||||
|
||||
# Pull and verify the manifest list.
|
||||
v22_protocol.pull_list(liveserver_session, 'devtable', 'newrepo', 'latest', manifestlist,
|
||||
credentials=credentials, options=options)
|
||||
|
|
Reference in a new issue