stream_layered_image: Use more descriptive variable name

This commit is contained in:
Utku Demir 2020-06-21 12:14:52 +12:00
parent 4bff5b7f3d
commit 87a538e149
No known key found for this signature in database
GPG Key ID: F3F8629C3E0BF60B

@ -160,9 +160,9 @@ def add_layer_dir(tar, paths, mtime, add_nix=True, filter=None):
(checksum, size) = extract_checksum.extract()
path = f"{checksum}/layer.tar"
ti = tarfile.TarInfo(path)
ti.size = size
ti.mtime = mtime
layer_tarinfo = tarfile.TarInfo(path)
layer_tarinfo.size = size
layer_tarinfo.mtime = mtime
# Then actually stream the contents to the outer tarball.
read_fd, write_fd = os.pipe()
@ -184,7 +184,7 @@ def add_layer_dir(tar, paths, mtime, add_nix=True, filter=None):
# exception handler, and the 'addfile' call will fail since it
# won't be able to read required amount of bytes.
threading.Thread(target=producer).start()
tar.addfile(ti, read)
tar.addfile(layer_tarinfo, read)
return LayerInfo(size=size, checksum=checksum, path=path, paths=paths)