@@ -24,6 +24,7 @@ import (
2424 "github.com/containerd/containerd/containers"
2525 "github.com/containerd/containerd/log"
2626 "github.com/containerd/containerd/oci"
27+ "github.com/containerd/containerd/snapshots"
2728 "github.com/containerd/typeurl"
2829 "github.com/davecgh/go-spew/spew"
2930 imagespec "github.com/opencontainers/image-spec/specs-go/v1"
@@ -180,6 +181,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
180181
181182 log .G (ctx ).Debugf ("Container %q spec: %#+v" , id , spew .NewFormatter (spec ))
182183
184+ snapshotterOpt := snapshots .WithLabels (config .Annotations )
183185 // Set snapshotter before any other options.
184186 opts := []containerd.NewContainerOpts {
185187 containerd .WithSnapshotter (c .config .ContainerdConfig .Snapshotter ),
@@ -188,7 +190,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
188190 // the runtime (runc) a chance to modify (e.g. to create mount
189191 // points corresponding to spec.Mounts) before making the
190192 // rootfs readonly (requested by spec.Root.Readonly).
191- customopts .WithNewSnapshot (id , containerdImage ),
193+ customopts .WithNewSnapshot (id , containerdImage , snapshotterOpt ),
192194 }
193195 if len (volumeMounts ) > 0 {
194196 mountMap := make (map [string ]string )
0 commit comments