1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix a bug which caused Graph.Register to fail when Graph.Mktemp() returns an existing directory.

This commit is contained in:
Solomon Hykes 2013-11-08 02:13:11 +00:00
parent 9afe475edb
commit 1764cf1990

View file

@ -62,12 +62,6 @@ func LoadImage(root string) (*Image, error) {
} }
func StoreImage(img *Image, jsonData []byte, layerData archive.Archive, root, rootfs string) error { func StoreImage(img *Image, jsonData []byte, layerData archive.Archive, root, rootfs string) error {
// Check that root doesn't already exist
if _, err := os.Stat(root); err == nil {
return fmt.Errorf("Image %s already exists", img.ID)
} else if !os.IsNotExist(err) {
return err
}
// Store the layer // Store the layer
layer := rootfs layer := rootfs
if err := os.MkdirAll(layer, 0755); err != nil { if err := os.MkdirAll(layer, 0755); err != nil {