Merge pull request #3392 from quay/squashed-additional-logging
Add additional logging information to squashed image exception
This commit is contained in:
commit
c7fe467cc8
1 changed files with 8 additions and 2 deletions
|
@ -35,7 +35,6 @@ class SquashedDockerImageFormatter(TarImageFormatter):
|
|||
if created is not None:
|
||||
image_mtime = calendar.timegm(created.utctimetuple())
|
||||
|
||||
|
||||
# Docker import V1 Format (.tar):
|
||||
# repositories - JSON file containing a repo -> tag -> image map
|
||||
# {image ID folder}:
|
||||
|
@ -86,7 +85,14 @@ class SquashedDockerImageFormatter(TarImageFormatter):
|
|||
# If the yielded size is more than the estimated size (which is unlikely but possible), then
|
||||
# raise an exception since the tar header will be wrong.
|
||||
if yielded_size > estimated_file_size:
|
||||
message = "Expected %s bytes, found %s bytes" % (estimated_file_size, yielded_size)
|
||||
leaf_image_id = parsed_manifest.leaf_layer_v1_image_id
|
||||
message = "For %s/%s:%s (%s:%s): Expected %s bytes, found %s bytes" % (namespace,
|
||||
repository,
|
||||
tag,
|
||||
parsed_manifest.digest,
|
||||
leaf_image_id,
|
||||
estimated_file_size,
|
||||
yielded_size)
|
||||
raise FileEstimationException(message)
|
||||
|
||||
# If the yielded size is less than the estimated size (which is likely), fill the rest with
|
||||
|
|
Reference in a new issue