Merge branch 'master' of github.com:coreos-inc/quay

This commit is contained in:
Joseph Schorr 2015-02-23 13:38:04 -05:00
commit a0706d20ae

View file

@ -1579,13 +1579,19 @@ def list_repository_tags(namespace_name, repository_name, include_hidden=False):
def _garbage_collect_tags(namespace_name, repository_name):
inner = (RepositoryTag
.select(RepositoryTag.id,
RepositoryTag.lifetime_end_ts,
RepositoryTag.repository)
.alias('rt'))
to_delete = (RepositoryTag
.select(RepositoryTag.id)
.join(Repository)
.select(inner.c.id)
.from_(inner)
.join(Repository, on=(inner.c.repository_id == Repository.id))
.join(Namespace, on=(Repository.namespace_user == Namespace.id))
.where(Repository.name == repository_name, Namespace.username == namespace_name,
~(RepositoryTag.lifetime_end_ts >> None),
(RepositoryTag.lifetime_end_ts + Namespace.removed_tag_expiration_s) <=
~(inner.c.lifetime_end_ts >> None),
(inner.c.lifetime_end_ts + Namespace.removed_tag_expiration_s) <=
int(time.time())))
(RepositoryTag