Fix a bug which caused Graph.Register to fail when Graph.Mktemp() returns an existing directory.
This commit is contained in:
parent
9afe475edb
commit
1764cf1990
6
image.go
6
image.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue