Fix snapshotter getter in client code

Fixes #3312

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2019-06-17 16:57:17 +00:00
parent cbb108e228
commit 41e1bb8328
5 changed files with 48 additions and 10 deletions

View File

@@ -43,6 +43,7 @@ import (
"github.com/containerd/containerd/content"
contentproxy "github.com/containerd/containerd/content/proxy"
"github.com/containerd/containerd/defaults"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/leases"
@@ -655,6 +656,14 @@ func (c *Client) Version(ctx context.Context) (Version, error) {
}, nil
}
func (c *Client) getSnapshotter(name string) (snapshots.Snapshotter, error) {
s := c.SnapshotService(name)
if s == nil {
return nil, errors.Wrapf(errdefs.ErrNotFound, "snapshotter %s was not found", name)
}
return s, nil
}
// CheckRuntime returns true if the current runtime matches the expected
// runtime. Providing various parts of the runtime schema will match those
// parts of the expected runtime