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:
parent
9afe475edb
commit
1764cf1990
1 changed files with 0 additions and 6 deletions
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 {
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue