Modify ctr run to search for read-only flag instead of readonly

Signed-off-by: Jie Hao Liao <liaojh1998@gmail.com>
This commit is contained in:
Jie Hao Liao 2019-12-04 00:15:44 -06:00
parent 5af0dcbe9d
commit 787be0efe2

View File

@ -116,13 +116,13 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
cOpts = append(cOpts, cOpts = append(cOpts,
containerd.WithImage(image), containerd.WithImage(image),
containerd.WithSnapshotter(snapshotter), containerd.WithSnapshotter(snapshotter),
// Even when "readonly" is set, we don't use KindView snapshot here. (#1495) // Even when "read-only" is set, we don't use KindView snapshot here. (#1495)
// We pass writable snapshot to the OCI runtime, and the runtime remounts it as read-only, // We pass writable snapshot to the OCI runtime, and the runtime remounts it as read-only,
// after creating some mount points on demand. // after creating some mount points on demand.
containerd.WithNewSnapshot(id, image), containerd.WithNewSnapshot(id, image),
containerd.WithImageStopSignal(image, "SIGTERM")) containerd.WithImageStopSignal(image, "SIGTERM"))
} }
if context.Bool("readonly") { if context.Bool("read-only") {
opts = append(opts, oci.WithRootFSReadonly()) opts = append(opts, oci.WithRootFSReadonly())
} }
if len(args) > 0 { if len(args) > 0 {