Fix image replication for images with remote layers
This commit is contained in:
parent
0eb84f8077
commit
180d8847db
7 changed files with 103 additions and 40 deletions
|
@ -250,13 +250,13 @@ def _write_manifest_and_log(namespace_name, repo_name, tag_name, manifest_impl):
|
|||
|
||||
# Queue all blob manifests for replication.
|
||||
if features.STORAGE_REPLICATION:
|
||||
layers = registry_model.list_manifest_layers(manifest)
|
||||
if layers is None:
|
||||
raise ManifestInvalid()
|
||||
|
||||
with queue_replication_batch(namespace_name) as queue_storage_replication:
|
||||
for layer in layers:
|
||||
queue_storage_replication(layer.blob)
|
||||
blobs = registry_model.get_manifest_local_blobs(manifest)
|
||||
if blobs is None:
|
||||
logger.error('Could not lookup blobs for manifest `%s`', manifest.digest)
|
||||
else:
|
||||
with queue_replication_batch(namespace_name) as queue_storage_replication:
|
||||
for blob_digest in blobs:
|
||||
queue_storage_replication(blob_digest)
|
||||
|
||||
track_and_log('push_repo', repository_ref, tag=tag_name)
|
||||
spawn_notification(repository_ref, 'repo_push', {'updated_tags': [tag_name]})
|
||||
|
|
Reference in a new issue