mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Allow drivers to export their own diff
This commit is contained in:
parent
9514767587
commit
1eb00e1d5b
2 changed files with 6 additions and 6 deletions
|
@ -1378,11 +1378,7 @@ 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)
|
||||||
}
|
}
|
||||||
imgDir, err := container.runtime.driver.Get(container.Image)
|
return container.runtime.driver.Diff(container.ID)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return archive.ExportChanges(container.RootfsPath(), imgDir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (container *Container) Export() (archive.Archive, error) {
|
func (container *Container) Export() (archive.Archive, error) {
|
||||||
|
|
|
@ -74,7 +74,11 @@ func (d *Driver) Get(id string) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) Diff(id string) (archive.Archive, error) {
|
func (d *Driver) Diff(id string) (archive.Archive, error) {
|
||||||
return nil, fmt.Errorf("Not implemented")
|
p, err := d.Get(id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return archive.Tar(p, archive.Uncompressed)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Driver) DiffSize(id string) (int64, error) {
|
func (d *Driver) DiffSize(id string) (int64, error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue