Allow drivers to export their own diff

This commit is contained in:
Michael Crosby 2013-11-08 15:32:50 -08:00
parent 9514767587
commit 1eb00e1d5b
2 changed files with 6 additions and 6 deletions

View File

@ -1378,11 +1378,7 @@ func (container *Container) ExportRw() (archive.Archive, error) {
if container.runtime == nil {
return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID)
}
imgDir, err := container.runtime.driver.Get(container.Image)
if err != nil {
return nil, err
}
return archive.ExportChanges(container.RootfsPath(), imgDir)
return container.runtime.driver.Diff(container.ID)
}
func (container *Container) Export() (archive.Archive, error) {

View File

@ -74,7 +74,11 @@ func (d *Driver) Get(id string) (string, 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) {