Browse Source

Allow drivers to export their own diff

Michael Crosby 11 years ago
parent
commit
1eb00e1d5b
2 changed files with 6 additions and 6 deletions
  1. 1 5
      container.go
  2. 5 1
      graphdriver/dummy/driver.go

+ 1 - 5
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) {

+ 5 - 1
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) {