1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

manifest: Close archive once done using it

manifest code calls TarLayer() and gets archive. This archive needs to
be closed once caller is done using it to release the resrouces held
by archive. For the devicemapper graphdriver, archive keeps a device
mounted (device which is backing the layer). If archive.Close() is not
called, that device remains mounted and later deletion of device fails
leading to various other issues.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 41bfa87b6c27b3f0041906f99ae9d0d9531db898
Component: engine
This commit is contained in:
Vivek Goyal
2015-02-11 11:30:45 -05:00
parent 552bf3d2e6
commit 6e39a35c8f

View File

@@ -73,6 +73,8 @@ func (s *TagStore) newManifest(localName, remoteName, tag string) ([]byte, error
return nil, err
}
defer archive.Close()
tarSum, err := tarsum.NewTarSum(archive, true, tarsum.Version1)
if err != nil {
return nil, err