Disallow access in the new registry model to hidden tags

This was causing problems with certain build cache pulls
This commit is contained in:
Joseph Schorr 2018-08-28 13:34:58 -04:00
parent c67da0c814
commit 70e233ab5c
3 changed files with 30 additions and 3 deletions

View file

@ -597,7 +597,8 @@ def get_active_tag_for_repo(repo, tag_name):
.join(Image)
.join(ImageStorage)
.where(RepositoryTag.name == tag_name,
RepositoryTag.repository == repo)).get()
RepositoryTag.repository == repo,
RepositoryTag.hidden == False)).get()
except RepositoryTag.DoesNotExist:
return None
@ -778,7 +779,7 @@ def get_most_recent_tag(repo_id):
try:
return (_tag_alive(RepositoryTag
.select()
.where(RepositoryTag.repository == repo_id)
.where(RepositoryTag.repository == repo_id, RepositoryTag.hidden == False)
.order_by(RepositoryTag.lifetime_start_ts.desc()))
.get())
except RepositoryTag.DoesNotExist: