From 987ffe56146bc4ff027a6e8468ec6965a086f76c Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 23 Jan 2019 15:09:17 -0500 Subject: [PATCH] Add a check for missing tag manifests This can occur if a manifest was moved to a different tag --- util/verifybackfill.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/util/verifybackfill.py b/util/verifybackfill.py index 8f680f0b8..9c790dfdf 100644 --- a/util/verifybackfill.py +++ b/util/verifybackfill.py @@ -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