Remove map call and estimate call
This commit is contained in:
parent
746936ce66
commit
3d3f2dd6d7
1 changed files with 2 additions and 14 deletions
|
@ -58,9 +58,7 @@ def _import_format_generator(namespace, repository, tag, synthetic_image_id,
|
|||
# Yield the merged layer data's header.
|
||||
estimated_file_size = 0
|
||||
for image in get_image_iterator():
|
||||
estimated_file_size += (image.storage.uncompressed_size or
|
||||
_get_mapped_size(image) or
|
||||
_estimate_size(image))
|
||||
estimated_file_size += image.storage.uncompressed_size
|
||||
|
||||
yield _tar_file_header(synthetic_image_id + '/layer.tar', estimated_file_size)
|
||||
|
||||
|
@ -127,14 +125,4 @@ def _tar_file_header(name, file_size):
|
|||
def _tar_folder(name):
|
||||
info = tarfile.TarInfo(name=name)
|
||||
info.type = tarfile.DIRTYPE
|
||||
return info.tobuf()
|
||||
|
||||
def _get_mapped_size(image):
|
||||
""" Returns a predefined image size for the given image or None if not found. """
|
||||
return None
|
||||
|
||||
def _estimate_size(image):
|
||||
""" Estimates a file size based on a heuristic. """
|
||||
# More than 1 SD away from the size difference in the DB, as of 9/29/2014
|
||||
return image.storage.image_size * 12
|
||||
|
||||
return info.tobuf()
|
||||
|
|
Reference in a new issue