diff --git a/client.go b/client.go index 340e41efc..b9184424d 100644 --- a/client.go +++ b/client.go @@ -49,6 +49,7 @@ import ( "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker/schema1" "github.com/containerd/containerd/snapshots" + snproxy "github.com/containerd/containerd/snapshots/proxy" "github.com/containerd/typeurl" ptypes "github.com/gogo/protobuf/types" ocispec "github.com/opencontainers/image-spec/specs-go/v1" @@ -467,7 +468,7 @@ func (c *Client) SnapshotService(snapshotterName string) snapshots.Snapshotter { if c.snapshotters != nil { return c.snapshotters[snapshotterName] } - return NewSnapshotterFromClient(snapshotsapi.NewSnapshotsClient(c.conn), snapshotterName) + return snproxy.NewSnapshotter(snapshotsapi.NewSnapshotsClient(c.conn), snapshotterName) } // TaskService returns the underlying TasksClient diff --git a/snapshot.go b/snapshots/proxy/proxy.go similarity index 96% rename from snapshot.go rename to snapshots/proxy/proxy.go index 155ec718f..e8828a6ce 100644 --- a/snapshot.go +++ b/snapshots/proxy/proxy.go @@ -14,7 +14,7 @@ limitations under the License. */ -package containerd +package proxy import ( "context" @@ -28,9 +28,9 @@ import ( protobuftypes "github.com/gogo/protobuf/types" ) -// NewSnapshotterFromClient returns a new Snapshotter which communicates -// over a GRPC connection. -func NewSnapshotterFromClient(client snapshotsapi.SnapshotsClient, snapshotterName string) snapshots.Snapshotter { +// NewSnapshotter returns a new Snapshotter which communicates over a GRPC +// connection using the containerd snapshot GRPC API. +func NewSnapshotter(client snapshotsapi.SnapshotsClient, snapshotterName string) snapshots.Snapshotter { return &remoteSnapshotter{ client: client, snapshotterName: snapshotterName,