Reporting the expiration got lost in a rebase

This ensure the tag expiration shows up in the UI
This commit is contained in:
Joseph Schorr 2017-07-26 11:29:21 -04:00
parent c271b1f386
commit f0b932559d
2 changed files with 7 additions and 2 deletions

View file

@ -151,13 +151,14 @@ class Release(
class Tag(
namedtuple('Tag', [
'name', 'image_docker_image_id', 'image_aggregate_size', 'lifetime_start_ts',
'tag_manifest_digest'
'tag_manifest_digest', 'lifetime_end_ts',
])):
"""
:type name: string
:type image_docker_image_id: string
:type image_aggregate_size: int
:type lifetime_start_ts: int
:type lifetime_end_ts: int|None
:type tag_manifest_digest: string
"""
@ -173,6 +174,10 @@ class Tag(
last_modified = format_date(datetime.fromtimestamp(self.lifetime_start_ts))
tag_info['last_modified'] = last_modified
if self.lifetime_end_ts:
expiration = format_date(datetime.fromtimestamp(self.lifetime_end_ts))
tag_info['expiration'] = expiration
if self.tag_manifest_digest is not None:
tag_info['manifest_digest'] = self.tag_manifest_digest

View file

@ -159,7 +159,7 @@ class PreOCIModel(RepositoryDataInterface):
return ImageRepositoryRepository(base, [
Tag(tag.name, tag.image.docker_image_id, tag.image.aggregate_size, tag.lifetime_start_ts,
tag.tagmanifest.digest) for tag in tags
tag.tagmanifest.digest, tag.lifetime_end_ts) for tag in tags
], [Count(count.date, count.count) for count in counts], repo.badge_token, repo.trust_enabled)