Fix bug where snapshots got created with wrong snapshotter
Snapshotters for run must be created with requested snapshotter. The order of the options is important to ensure that the snapshotter is set before the snapshots are created. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -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))
|
||||||
|
Reference in New Issue
Block a user