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
1 changed files with 0 additions and 6 deletions

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 {
// 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
layer := rootfs
if err := os.MkdirAll(layer, 0755); err != nil {