Merge pull request #3343 from quay/fix-backfill-verify-tool

Add a check for missing tag manifests
This commit is contained in:
Joseph Schorr 2019-01-23 15:12:40 -05:00 committed by GitHub
commit a4cd7fbc0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,14 +45,17 @@ def verify_backfill(namespace_name):
else:
assert tag.lifetime_end_ms is None
tag_manifest = tag.manifest
repo_tag_manifest = TagManifest.get(tag=repo_tag)
try:
tag_manifest = tag.manifest
repo_tag_manifest = TagManifest.get(tag=repo_tag)
digest_check = tag_manifest.digest == repo_tag_manifest.digest
assert digest_check, _vs(tag_manifest.digest, repo_tag_manifest.digest)
digest_check = tag_manifest.digest == repo_tag_manifest.digest
assert digest_check, _vs(tag_manifest.digest, repo_tag_manifest.digest)
bytes_check = tag_manifest.manifest_bytes == repo_tag_manifest.json_data
assert bytes_check, _vs(tag_manifest.manifest_bytes, repo_tag_manifest.json_data)
bytes_check = tag_manifest.manifest_bytes == repo_tag_manifest.json_data
assert bytes_check, _vs(tag_manifest.manifest_bytes, repo_tag_manifest.json_data)
except TagManifest.DoesNotExist:
logger.info('No tag manifest found for repository tag %s', repo_tag.id)
mli = ManifestLegacyImage.get(manifest=tag_manifest)
assert mli.repository == repo_tag.repository