Some small cleanup to the tag backfill worker

This commit is contained in:
Joseph Schorr 2019-01-21 13:37:11 -05:00
parent bd6efe9563
commit c1ac12ff8d
3 changed files with 4 additions and 7 deletions

View file

@ -175,7 +175,7 @@ def backfill_tag(repositorytag):
if lookup_map_row(repositorytag):
return False
# Grab the manifest for the RepositoryTag, backfilling is necessary.
# Grab the manifest for the RepositoryTag, backfilling as necessary.
manifest_id = _get_manifest_id(repositorytag)
if manifest_id is None:
return False
@ -269,7 +269,8 @@ def _backfill_manifest(tag_manifest):
# without additional rows or data, as it will eventually not be useful.
is_broken = False
try:
manifest = DockerSchema1Manifest.for_latin1_bytes(tag_manifest.json_data, validate=False)
manifest = DockerSchema1Manifest(Bytes.for_string_or_unicode(tag_manifest.json_data),
validate=False)
except ManifestException:
logger.exception('Exception when trying to parse manifest %s', tag_manifest.id)
manifest = BrokenManifest(tag_manifest.digest, tag_manifest.json_data)