Merge pull request #27965 from dmcgowan/remove-rw-tar-stream-from

Remove TarStreamFrom from RWLayer interface
This commit is contained in:
Vincent Demeester 2016-11-02 10:18:20 +01:00 committed by GitHub
commit 6740bc5895
2 changed files with 4 additions and 11 deletions

View file

@ -78,15 +78,16 @@ type TarStreamer interface {
// TarStream returns a tar archive stream
// for the contents of a layer.
TarStream() (io.ReadCloser, error)
// TarStreamFrom returns a tar archive stream for all the layer chain with
// arbitrary depth.
TarStreamFrom(ChainID) (io.ReadCloser, error)
}
// Layer represents a read-only layer
type Layer interface {
TarStreamer
// TarStreamFrom returns a tar archive stream for all the layer chain with
// arbitrary depth.
TarStreamFrom(ChainID) (io.ReadCloser, error)
// ChainID returns the content hash of the entire layer chain. The hash
// chain is made up of DiffID of top layer and all of its parents.
ChainID() ChainID

View file

@ -1,7 +1,6 @@
package layer
import (
"fmt"
"io"
"github.com/docker/docker/pkg/archive"
@ -32,13 +31,6 @@ func (ml *mountedLayer) TarStream() (io.ReadCloser, error) {
return ml.layerStore.driver.Diff(ml.mountID, ml.cacheParent())
}
func (ml *mountedLayer) TarStreamFrom(parent ChainID) (io.ReadCloser, error) {
// Not supported since this will include the init layer as well
// This can already be acheived with mount + tar.
// Should probably never reach this point, but error out here.
return nil, fmt.Errorf("getting a layer diff from an arbitrary parent is not supported on mounted layer")
}
func (ml *mountedLayer) Name() string {
return ml.name
}