Fix regiression from #3403 with snapshot cmd

The snapshot command calls the snapshotter service directly, therefore,
the name must be resolved.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2019-07-16 19:24:24 +00:00
parent d6be45e151
commit ce0d2489ac

View File

@ -557,6 +557,10 @@ func (c *Client) ContentStore() content.Store {
// SnapshotService returns the underlying snapshotter for the provided snapshotter name // SnapshotService returns the underlying snapshotter for the provided snapshotter name
func (c *Client) SnapshotService(snapshotterName string) snapshots.Snapshotter { func (c *Client) SnapshotService(snapshotterName string) snapshots.Snapshotter {
snapshotterName, err := c.resolveSnapshotterName(context.Background(), snapshotterName)
if err != nil {
snapshotterName = DefaultSnapshotter
}
if c.snapshotters != nil { if c.snapshotters != nil {
return c.snapshotters[snapshotterName] return c.snapshotters[snapshotterName]
} }