summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/utils.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2017-07-21 13:13:19 +0100
committerRadostin Stoyanov <rstoyanov1@gmail.com>2017-07-21 13:31:26 +0100
commit2762d815643754bc4f5b4a922989fc1acf5ea5b6 (patch)
tree8124fcb86d7a2cdf10c82dad77f27a8402f26a3e /src/virtBootstrap/utils.py
parent648965c97c82d1aee45de696bba5eec19aa722e4 (diff)
downloadvirt-bootstrap.git-2762d815643754bc4f5b4a922989fc1acf5ea5b6.tar.gz
virt-bootstrap.git-2762d815643754bc4f5b4a922989fc1acf5ea5b6.tar.xz
virt-bootstrap.git-2762d815643754bc4f5b4a922989fc1acf5ea5b6.zip
DockerSource: Add support for Manifest version 1
Handle differences between version 1 and 2 of the Manifest file for Docker registry. Layers' blob sums in v1 are stored in a list "fsLayers" and the digest is stored in following filed with name "blobSum". [1] In v2 the layer list is stored in field with name "layers" and ordered starting from the base image (opposite order of v1). The digest is stored under a following field with name "digest". The size in bytes is included in a field with name "size". [2] [1] https://docs.docker.com/registry/spec/manifest-v2-1/#manifest-field-descriptions [2] https://docs.docker.com/registry/spec/manifest-v2-2/#image-manifest-field-descriptions
Diffstat (limited to 'src/virtBootstrap/utils.py')
-rw-r--r--src/virtBootstrap/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
index daabd26..a65d3f5 100644
--- a/src/virtBootstrap/utils.py
+++ b/src/virtBootstrap/utils.py
@@ -138,8 +138,11 @@ def log_layer_extract(layer, current, total, progress):
Create log message on layer extract.
"""
sum_type, sum_value, layer_file, layer_size = layer
- progress("Extracting layer (%s/%s) with size: %s"
- % (current, total, bytes_to_size(layer_size)), logger=logger)
+ msg = 'Extracting layer (%s/%s)' % (current, total)
+
+ if layer_size:
+ msg += " with size: %s" % bytes_to_size(layer_size)
+ progress(msg, logger=logger)
logger.debug('Untar layer: (%s:%s) %s', sum_type, sum_value, layer_file)