From 1eb00e1d5b375cb79d492f1c5cd95d7317bc543c Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 8 Nov 2013 15:32:50 -0800 Subject: [PATCH] Allow drivers to export their own diff --- container.go | 6 +----- graphdriver/dummy/driver.go | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/container.go b/container.go index 6dee2335ff..32359b9cb7 100644 --- a/container.go +++ b/container.go @@ -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) { diff --git a/graphdriver/dummy/driver.go b/graphdriver/dummy/driver.go index d62f7de27f..41a3e62a1f 100644 --- a/graphdriver/dummy/driver.go +++ b/graphdriver/dummy/driver.go @@ -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) {