Skip to content

Commit 553c260

Browse files
author
Mrunal Patel
authored
Merge pull request opencontainers#254 from Mashimiao/generate-update-rootfs-options
generate: update rootfs releated options
2 parents 414d0e8 + d0d4f2d commit 553c260

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

cmd/oci-runtime-tool/generate.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ var generateFlags = []cli.Flag{
5959
cli.StringSliceFlag{Name: "poststop", Usage: "set command to run in poststop hooks"},
6060
cli.StringSliceFlag{Name: "prestart", Usage: "set command to run in prestart hooks"},
6161
cli.BoolFlag{Name: "privileged", Usage: "enable privileged container settings"},
62-
cli.BoolFlag{Name: "read-only", Usage: "make the container's rootfs read-only"},
6362
cli.StringSliceFlag{Name: "readonly-paths", Usage: "specifies paths readonly inside container"},
64-
cli.StringFlag{Name: "root-propagation", Usage: "mount propagation for root"},
65-
cli.StringFlag{Name: "rootfs", Value: "rootfs", Usage: "path to the rootfs"},
63+
cli.StringFlag{Name: "rootfs-path", Value: "rootfs", Usage: "path to the root filesystem"},
64+
cli.StringFlag{Name: "rootfs-propagation", Usage: "mount propagation for rootfs"},
65+
cli.BoolFlag{Name: "rootfs-readonly", Usage: "make the container's rootfs readonly"},
6666
cli.StringFlag{Name: "seccomp-allow", Usage: "specifies syscalls to respond with allow"},
6767
cli.StringFlag{Name: "seccomp-arch", Usage: "specifies additional architectures permitted to be used for system calls"},
6868
cli.StringFlag{Name: "seccomp-default", Usage: "specifies default action to be used for system calls and removes existing rules with specified action"},
@@ -155,10 +155,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
155155
}
156156
}
157157

158-
g.SetRootPath(context.String("rootfs"))
158+
g.SetRootPath(context.String("rootfs-path"))
159159

160-
if context.IsSet("read-only") {
161-
g.SetRootReadonly(context.Bool("read-only"))
160+
if context.IsSet("rootfs-readonly") {
161+
g.SetRootReadonly(context.Bool("rootfs-readonly"))
162162
}
163163

164164
if context.IsSet("uid") {
@@ -335,8 +335,8 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
335335
}
336336
}
337337

338-
if context.IsSet("root-propagation") {
339-
rp := context.String("root-propagation")
338+
if context.IsSet("rootfs-propagation") {
339+
rp := context.String("rootfs-propagation")
340340
if err := g.SetLinuxRootPropagation(rp); err != nil {
341341
return err
342342
}

completions/bash/oci-runtime-tool

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ _oci-runtime-tool_generate() {
299299
--poststop
300300
--prestart
301301
--readonly-paths
302-
--root-propagation
303-
--rootfs
302+
--rootfs-path
303+
--rootfs-propagation
304304
--seccomp-allow
305305
--seccomp-arch
306306
--seccomp-default
@@ -326,7 +326,7 @@ _oci-runtime-tool_generate() {
326326
local boolean_options="
327327
--no-new-privileges
328328
--privileged
329-
--read-only
329+
--rootfs-readonly
330330
--tty
331331
"
332332

man/oci-runtime-tool-generate.1.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,17 @@ read the configuration from `config.json`.
214214
Specifies paths readonly inside container. e.g. --readonly-paths=/proc/sys
215215
This option can be specified multiple times.
216216

217-
**--read-only**=true|false
218-
Mount the container's root filesystem as read only.
219-
220-
By default a container will have its root filesystem writable allowing processes to write files anywhere. By specifying the `--read-only` flag the container will have its root filesystem mounted as read only prohibiting any writes.
217+
**--rootfs-path**=ROOTFSPATH
218+
Path to the root filesystem
221219

222-
**--root-propagation**=PROPOGATIONMODE
220+
**--rootfs-propagation**=PROPOGATIONMODE
223221
Mount propagation for root filesystem.
224222
Values are "shared, rshared, private, rprivate, slave, rslave"
225223

226-
**--rootfs**=ROOTFSPATH
227-
Path to the rootfs
224+
**--rootfs-readonly**=true|false
225+
Mount the container's root filesystem as read only.
226+
227+
By default a container will have its root filesystem writable allowing processes to write files anywhere. By specifying the `--rootfs-readonly` flag the container will have its root filesystem mounted as read only prohibiting any writes.
228228

229229
**--seccomp-allow**=SYSCALL
230230
Specifies syscalls to be added to the ALLOW list.

0 commit comments

Comments
 (0)