Merge pull request #2821 from coreos-inc/fix-expiration

Reporting the expiration got lost in a rebase
This commit is contained in:
josephschorr 2017-07-26 11:39:34 -04:00 committed by GitHub
commit a7de27fe14
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)