Merge pull request #3226 from quay/retarget-return

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:56:13 -04:00 committed by GitHub
commit 95b7850c20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)