From 0d1807a43d11e8e59b14665b52abba1f3ee56de8 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Tue, 8 May 2018 14:39:07 -0700 Subject: [PATCH] Move client snapshotter to separate package Signed-off-by: Derek McGowan --- client.go | 3 ++- snapshot.go => snapshots/proxy/proxy.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) rename snapshot.go => snapshots/proxy/proxy.go (96%) 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,