Do not decompress 'compressed' containers
Do not decompress the image if container_format is compressed Change-Id: I913d9bf11479d2519f7887e42626e9e386d83d7a
This commit is contained in:
parent
2d21685ee4
commit
a2e0fb61e9
|
@ -628,6 +628,11 @@ only compressed images.
|
|||
where "service_role" is the role which is created for the service user
|
||||
and assigned to trusted services.
|
||||
|
||||
.. note::
|
||||
|
||||
The plugin will not decompressed images which container_format is set
|
||||
to 'compressed' to maintain the original intent of the image creator.
|
||||
|
||||
To use the Image Decompression Plugin, the following configuration is
|
||||
required.
|
||||
|
||||
|
|
|
@ -121,6 +121,11 @@ class _DecompressImage(task.Task):
|
|||
# account and handle the paths here.
|
||||
src_path = file_path.split('file://')[-1]
|
||||
self.dest_path = "%(path)s.uc" % {'path': src_path}
|
||||
image = self.image_repo.get(self.image_id)
|
||||
# NOTE(jokke): If the container format is 'compressed' the image is
|
||||
# expected to be compressed so lets not decompress it.
|
||||
if image.container_format == 'compressed':
|
||||
return "file://%s" % src_path
|
||||
head = None
|
||||
with open(src_path, 'rb') as fd:
|
||||
head = fd.read(MAX_HEADER)
|
||||
|
|
Loading…
Reference in New Issue