Get the base image stuff working. Checkpoint before fixing the tests.
This commit is contained in:
parent
5742e6ea4e
commit
b619356907
120 changed files with 305 additions and 261 deletions
|
@ -1012,7 +1012,6 @@ def list_repos():
|
|||
if include_count:
|
||||
repo_count = model.get_visible_repository_count(username,
|
||||
include_public=include_public,
|
||||
sort=sort,
|
||||
namespace=namespace_filter)
|
||||
|
||||
repo_query = model.get_visible_repositories(username, limit=limit, page=page,
|
||||
|
@ -1089,14 +1088,16 @@ def delete_repository(namespace, repository):
|
|||
|
||||
|
||||
def image_view(image):
|
||||
extended_props = image.storage or image
|
||||
command = extended_props.command
|
||||
return {
|
||||
'id': image.docker_image_id,
|
||||
'created': image.created,
|
||||
'comment': image.comment,
|
||||
'command': json.loads(image.command) if image.command else None,
|
||||
'created': extended_props.created,
|
||||
'comment': extended_props.comment,
|
||||
'command': json.loads(command) if command else None,
|
||||
'ancestors': image.ancestors,
|
||||
'dbid': image.id,
|
||||
'size': image.image_size,
|
||||
'size': extended_props.image_size,
|
||||
}
|
||||
|
||||
|
||||
|
@ -1399,7 +1400,14 @@ def get_image(namespace, repository, image_id):
|
|||
def get_image_changes(namespace, repository, image_id):
|
||||
permission = ReadRepositoryPermission(namespace, repository)
|
||||
if permission.can() or model.repository_is_public(namespace, repository):
|
||||
diffs_path = store.image_file_diffs_path(namespace, repository, image_id)
|
||||
image = model.get_repo_image(namespace, repository, image_id)
|
||||
|
||||
if not image:
|
||||
abort(404)
|
||||
|
||||
uuid = image.storage and image.storage.uuid
|
||||
diffs_path = store.image_file_diffs_path(namespace, repository, image_id,
|
||||
uuid)
|
||||
|
||||
try:
|
||||
response_json = store.get_content(diffs_path)
|
||||
|
@ -1416,7 +1424,8 @@ def get_image_changes(namespace, repository, image_id):
|
|||
def delete_full_tag(namespace, repository, tag):
|
||||
permission = AdministerRepositoryPermission(namespace, repository)
|
||||
if permission.can():
|
||||
model.delete_tag_and_images(namespace, repository, tag)
|
||||
model.delete_tag(namespace, repository, tag)
|
||||
model.garbage_collect_repository(namespace, repository)
|
||||
|
||||
username = current_user.db_user().username
|
||||
log_action('delete_tag', namespace,
|
||||
|
|
Reference in a new issue