Implement UI support for manifest lists
This commit is contained in:
parent
276d0d571d
commit
c46b11bac1
14 changed files with 338 additions and 157 deletions
|
@ -1,4 +1,5 @@
|
|||
""" Manage the tags of a repository. """
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from flask import request, abort
|
||||
|
@ -27,14 +28,26 @@ def _tag_dict(tag):
|
|||
if tag.lifetime_end_ts > 0:
|
||||
tag_info['end_ts'] = tag.lifetime_end_ts
|
||||
|
||||
if tag.manifest_digest:
|
||||
tag_info['manifest_digest'] = tag.manifest_digest
|
||||
|
||||
if tag.legacy_image:
|
||||
# TODO(jschorr): Remove this once fully on OCI data model.
|
||||
if tag.legacy_image_if_present:
|
||||
tag_info['docker_image_id'] = tag.legacy_image.docker_image_id
|
||||
tag_info['image_id'] = tag.legacy_image.docker_image_id
|
||||
tag_info['size'] = tag.legacy_image.aggregate_size
|
||||
|
||||
# TODO(jschorr): Remove this check once fully on OCI data model.
|
||||
if tag.manifest_digest:
|
||||
tag_info['manifest_digest'] = tag.manifest_digest
|
||||
if tag.manifest:
|
||||
try:
|
||||
tag_info['manifest'] = json.loads(tag.manifest.manifest_bytes)
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
tag_info['is_manifest_list'] = tag.manifest.is_manifest_list
|
||||
|
||||
if 'size' not in tag_info:
|
||||
tag_info['size'] = tag.manifest.layers_compressed_size
|
||||
|
||||
if tag.lifetime_start_ts > 0:
|
||||
last_modified = format_date(datetime.utcfromtimestamp(tag.lifetime_start_ts))
|
||||
tag_info['last_modified'] = last_modified
|
||||
|
|
Reference in a new issue