Reverting a tag doesn't mean it always has an existing image, so remove that check

This commit is contained in:
Joseph Schorr 2018-08-27 12:52:27 -04:00
parent fb9c4fecce
commit 55afa2ca08

View file

@ -193,15 +193,11 @@ class PreOCIModel(RegistryDataInterface):
manifest_or_legacy_image.docker_image_id)
else:
if isinstance(manifest_or_legacy_image, Manifest):
image = model.tag.restore_tag_to_manifest(repository_ref._db_id, tag_name,
manifest_or_legacy_image.digest)
if image is None:
return None
model.tag.restore_tag_to_manifest(repository_ref._db_id, tag_name,
manifest_or_legacy_image.digest)
else:
image = model.tag.restore_tag_to_image(repository_ref._db_id, tag_name,
manifest_or_legacy_image.docker_image_id)
if image is None:
return None
model.tag.restore_tag_to_image(repository_ref._db_id, tag_name,
manifest_or_legacy_image.docker_image_id)
return self.get_repo_tag(repository_ref, tag_name, include_legacy_image=True)