Fix sandbox container snapshotter.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-08-30 18:33:49 +00:00
parent 2aea0388be
commit c4d95aa2c4
6 changed files with 30 additions and 11 deletions

View File

@@ -92,7 +92,10 @@ func (c *criContainerdService) CreateContainer(ctx context.Context, r *runtime.C
}
glog.V(4).Infof("Container spec: %+v", spec)
var opts []containerd.NewContainerOpts
// Set snapshotter before any other options.
opts := []containerd.NewContainerOpts{
containerd.WithSnapshotter(c.snapshotter),
}
// Prepare container rootfs.
if config.GetLinux().GetSecurityContext().GetReadonlyRootfs() {
opts = append(opts, containerd.WithNewSnapshotView(id, image.Image))