Add image ancestry and update the test db accordingly.
This commit is contained in:
parent
abdf731f7a
commit
ea6df2b725
5 changed files with 43 additions and 14 deletions
|
@ -188,10 +188,15 @@ def role_view(repo_perm_obj):
|
|||
def list_tag_images(namespace, repository, tag):
|
||||
permission = ReadRepositoryPermission(namespace, repository)
|
||||
if permission.can() or model.repository_is_public(namespace, repository):
|
||||
images = model.get_tag_images(namespace, repository, tag)
|
||||
tag_image = model.get_tag_image(namespace, repository, tag)
|
||||
parent_images = model.get_parent_images(tag_image)
|
||||
|
||||
parents = list(parent_images)
|
||||
parents.reverse()
|
||||
all_images = [tag_image] + parents
|
||||
|
||||
return jsonify({
|
||||
'images': [image_view(image) for image in images]
|
||||
'images': [image_view(image) for image in all_images]
|
||||
})
|
||||
|
||||
abort(403) # Permission denied
|
||||
|
|
Reference in a new issue