Change error message when trying to pull a deleted or expired tag

Will let the users know they can recover the tag via time machine

Note: This was tested with the Docker protocol, but the new error code is *technically* out of spec; we should make sure its okay.
This commit is contained in:
Joseph Schorr 2017-06-21 21:58:16 -04:00
parent 99d7fde8ee
commit 7d4fed6892
7 changed files with 39 additions and 7 deletions

View file

@ -37,6 +37,13 @@ class PreOCIModel(DockerRegistryV2DataInterface):
except database.RepositoryTag.DoesNotExist:
return False
def has_tag(self, namespace_name, repo_name, tag_name):
try:
model.tag.get_possibly_expired_tag(namespace_name, repo_name, tag_name)
return True
except database.RepositoryTag.DoesNotExist:
return False
def get_manifest_by_tag(self, namespace_name, repo_name, tag_name):
try:
manifest = model.tag.load_tag_manifest(namespace_name, repo_name, tag_name)