Merge pull request #1293 from dmcgowan/fix-snapshotter-run

Fix ctr run bug when snapshotter is provided
This commit is contained in:
Michael Crosby 2017-08-04 17:07:49 -04:00 committed by GitHub
commit de7afd8aa8

View File

@ -92,12 +92,12 @@ func newContainer(ctx gocontext.Context, client *containerd.Client, context *cli
} }
opts = append(opts, containerd.WithImageConfig(ctx, image)) opts = append(opts, containerd.WithImageConfig(ctx, image))
cOpts = append(cOpts, containerd.WithImage(image)) cOpts = append(cOpts, containerd.WithImage(image))
cOpts = append(cOpts, containerd.WithSnapshotter(context.String("snapshotter")))
if context.Bool("readonly") { if context.Bool("readonly") {
cOpts = append(cOpts, containerd.WithNewSnapshotView(id, image)) cOpts = append(cOpts, containerd.WithNewSnapshotView(id, image))
} else { } else {
cOpts = append(cOpts, containerd.WithNewSnapshot(id, image)) cOpts = append(cOpts, containerd.WithNewSnapshot(id, image))
} }
cOpts = append(cOpts, containerd.WithSnapshotter(context.String("snapshotter")))
} }
opts = append(opts, withEnv(context), withMounts(context)) opts = append(opts, withEnv(context), withMounts(context))