Fix disabled namespace check

This commit is contained in:
Joseph Schorr 2018-10-08 16:32:09 +01:00
parent cbf0edb164
commit 4a7b4ad06a
9 changed files with 32 additions and 23 deletions

View file

@ -214,7 +214,8 @@ def list_active_repo_tags(repo, start_id=None, limit=None):
.join(ImageStorage)
.where(RepositoryTag.repository == repo, RepositoryTag.hidden == False)
.switch(RepositoryTag)
.join(TagManifest, JOIN.LEFT_OUTER))
.join(TagManifest, JOIN.LEFT_OUTER)
.order_by(RepositoryTag.id))
if start_id is not None:
query = query.where(RepositoryTag.id >= start_id)
@ -775,11 +776,11 @@ def change_repository_tag_expiration(namespace_name, repo_name, tag_name, expira
def set_tag_expiration_for_manifest(tag_manifest, expiration_sec):
"""
Changes the expiration of the tag that point to the given manifest to be its lifetime start +
Changes the expiration of the tag that points to the given manifest to be its lifetime start +
the expiration seconds.
"""
expiration_time_in_seconds = tag_manifest.tag.lifetime_start_ts + expiration_sec
expiration_date = datetime.utcfromtimestamp(expiration_time_in_seconds)
expiration_time_ts = tag_manifest.tag.lifetime_start_ts + expiration_sec
expiration_date = datetime.utcfromtimestamp(expiration_time_ts)
return change_tag_expiration(tag_manifest.tag, expiration_date)