mirror of https://github.com/docker/docs.git
Merge pull request #3915 from crosbymichael/no-double-put
No no put put
This commit is contained in:
commit
b5d6208ccf
10
container.go
10
container.go
|
@ -1416,9 +1416,12 @@ func (container *Container) ExportRw() (archive.Archive, error) {
|
||||||
if container.runtime == nil {
|
if container.runtime == nil {
|
||||||
return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID)
|
return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID)
|
||||||
}
|
}
|
||||||
defer container.Unmount()
|
archive, err := container.runtime.Diff(container)
|
||||||
|
if err != nil {
|
||||||
return container.runtime.Diff(container)
|
container.Unmount()
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return EofReader(archive, func() { container.Unmount() }), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (container *Container) Export() (archive.Archive, error) {
|
func (container *Container) Export() (archive.Archive, error) {
|
||||||
|
@ -1428,6 +1431,7 @@ func (container *Container) Export() (archive.Archive, error) {
|
||||||
|
|
||||||
archive, err := archive.Tar(container.basefs, archive.Uncompressed)
|
archive, err := archive.Tar(container.basefs, archive.Uncompressed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
container.Unmount()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return EofReader(archive, func() { container.Unmount() }), nil
|
return EofReader(archive, func() { container.Unmount() }), nil
|
||||||
|
|
Loading…
Reference in New Issue