Browse Source

Merge pull request #10596 from rhvgoyal/manifest-close-archive

manifest: Close archive once done to umount the device backing the layer
Jessie Frazelle 10 years ago
parent
commit
3e039e8748
2 changed files with 4 additions and 0 deletions
  1. 2 0
      graph/manifest.go
  2. 2 0
      graph/push.go

+ 2 - 0
graph/manifest.go

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

+ 2 - 0
graph/push.go

@@ -392,6 +392,8 @@ func (s *TagStore) pushV2Image(r *registry.Session, img *image.Image, endpoint *
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
+	defer arch.Close()
+
 	tf, err := s.graph.newTempFile()
 	tf, err := s.graph.newTempFile()
 	if err != nil {
 	if err != nil {
 		return err
 		return err