Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/oci-runtime-tool/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ var generateFlags = []cli.Flag{
cli.StringSliceFlag{Name: "poststop", Usage: "set command to run in poststop hooks"},
cli.StringSliceFlag{Name: "prestart", Usage: "set command to run in prestart hooks"},
cli.BoolFlag{Name: "privileged", Usage: "enable privileged container settings"},
cli.BoolFlag{Name: "read-only", Usage: "make the container's rootfs read-only"},
cli.StringSliceFlag{Name: "readonly-paths", Usage: "specifies paths readonly inside container"},
cli.StringFlag{Name: "root-propagation", Usage: "mount propagation for root"},
cli.StringFlag{Name: "rootfs", Value: "rootfs", Usage: "path to the rootfs"},
cli.StringFlag{Name: "rootfs-path", Value: "rootfs", Usage: "path to the root filesystem"},
cli.StringFlag{Name: "rootfs-propagation", Usage: "mount propagation for rootfs"},
cli.BoolFlag{Name: "rootfs-readonly", Usage: "make the container's rootfs readonly"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config.json property is root, so I'd prefer sticking to root instead of switching to rootfs. Other than that these changes look good to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Then, let's see what's other people's opinions?

cli.StringFlag{Name: "seccomp-allow", Usage: "specifies syscalls to respond with allow"},
cli.StringFlag{Name: "seccomp-arch", Usage: "specifies additional architectures permitted to be used for system calls"},
cli.StringFlag{Name: "seccomp-default", Usage: "specifies default action to be used for system calls and removes existing rules with specified action"},
Expand Down Expand Up @@ -155,10 +155,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
}
}

g.SetRootPath(context.String("rootfs"))
g.SetRootPath(context.String("rootfs-path"))

if context.IsSet("read-only") {
g.SetRootReadonly(context.Bool("read-only"))
if context.IsSet("rootfs-readonly") {
g.SetRootReadonly(context.Bool("rootfs-readonly"))
}

if context.IsSet("uid") {
Expand Down Expand Up @@ -335,8 +335,8 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
}
}

if context.IsSet("root-propagation") {
rp := context.String("root-propagation")
if context.IsSet("rootfs-propagation") {
rp := context.String("rootfs-propagation")
if err := g.SetLinuxRootPropagation(rp); err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions completions/bash/oci-runtime-tool
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ _oci-runtime-tool_generate() {
--poststop
--prestart
--readonly-paths
--root-propagation
--rootfs
--rootfs-path
--rootfs-propagation
--seccomp-allow
--seccomp-arch
--seccomp-default
Expand All @@ -326,7 +326,7 @@ _oci-runtime-tool_generate() {
local boolean_options="
--no-new-privileges
--privileged
--read-only
--rootfs-readonly
--tty
"

Expand Down
14 changes: 7 additions & 7 deletions man/oci-runtime-tool-generate.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,17 @@ read the configuration from `config.json`.
Specifies paths readonly inside container. e.g. --readonly-paths=/proc/sys
This option can be specified multiple times.

**--read-only**=true|false
Mount the container's root filesystem as read only.

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.
**--rootfs-path**=ROOTFSPATH
Path to the root filesystem

**--root-propagation**=PROPOGATIONMODE
**--rootfs-propagation**=PROPOGATIONMODE
Mount propagation for root filesystem.
Values are "shared, rshared, private, rprivate, slave, rslave"

**--rootfs**=ROOTFSPATH
Path to the rootfs
**--rootfs-readonly**=true|false
Mount the container's root filesystem as read only.

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.

**--seccomp-allow**=SYSCALL
Specifies syscalls to be added to the ALLOW list.
Expand Down