Add a log for an integrity error in writing a manifest

This commit is contained in:
Joseph Schorr 2019-02-05 18:04:11 -05:00
parent f8dd8b2494
commit 82897a2bba

View file

@ -799,7 +799,8 @@ def populate_manifest(repository, manifest, legacy_image, storage_ids):
manifest_row = Manifest.create(digest=manifest.digest, repository=repository,
manifest_bytes=manifest.bytes.as_encoded_str(),
media_type=media_type)
except IntegrityError:
except IntegrityError as ie:
logger.debug('Got integrity error when trying to write manifest: %s', ie)
return Manifest.get(repository=repository, digest=manifest.digest)
ManifestLegacyImage.create(manifest=manifest_row, repository=repository, image=legacy_image)