Reporting the expiration got lost in a rebase
This ensure the tag expiration shows up in the UI
This commit is contained in:
parent
c271b1f386
commit
f0b932559d
2 changed files with 7 additions and 2 deletions
|
@ -151,13 +151,14 @@ class Release(
|
||||||
class Tag(
|
class Tag(
|
||||||
namedtuple('Tag', [
|
namedtuple('Tag', [
|
||||||
'name', 'image_docker_image_id', 'image_aggregate_size', 'lifetime_start_ts',
|
'name', 'image_docker_image_id', 'image_aggregate_size', 'lifetime_start_ts',
|
||||||
'tag_manifest_digest'
|
'tag_manifest_digest', 'lifetime_end_ts',
|
||||||
])):
|
])):
|
||||||
"""
|
"""
|
||||||
:type name: string
|
:type name: string
|
||||||
:type image_docker_image_id: string
|
:type image_docker_image_id: string
|
||||||
:type image_aggregate_size: int
|
:type image_aggregate_size: int
|
||||||
:type lifetime_start_ts: int
|
:type lifetime_start_ts: int
|
||||||
|
:type lifetime_end_ts: int|None
|
||||||
:type tag_manifest_digest: string
|
:type tag_manifest_digest: string
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -173,6 +174,10 @@ class Tag(
|
||||||
last_modified = format_date(datetime.fromtimestamp(self.lifetime_start_ts))
|
last_modified = format_date(datetime.fromtimestamp(self.lifetime_start_ts))
|
||||||
tag_info['last_modified'] = last_modified
|
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:
|
if self.tag_manifest_digest is not None:
|
||||||
tag_info['manifest_digest'] = self.tag_manifest_digest
|
tag_info['manifest_digest'] = self.tag_manifest_digest
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ class PreOCIModel(RepositoryDataInterface):
|
||||||
|
|
||||||
return ImageRepositoryRepository(base, [
|
return ImageRepositoryRepository(base, [
|
||||||
Tag(tag.name, tag.image.docker_image_id, tag.image.aggregate_size, tag.lifetime_start_ts,
|
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)
|
], [Count(count.date, count.count) for count in counts], repo.badge_token, repo.trust_enabled)
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue