1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Remove TarStreamFrom from RWLayer interface

RWLayers do not implement the tar stream from, moved the
definition to Layer instead of TarStreamer

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
Derek McGowan 2016-11-01 14:44:27 -07:00
parent 70459d6f1e
commit 8625d25351
No known key found for this signature in database
GPG key ID: F58C5D0A4405ACDB
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
}