mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 12:41:42 +00:00
Allow drivers to export their own diff
This commit is contained in:
+1
-5
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user