Skip to content

[RFC] runc cli: --rootless flag idiosyncrasiesย #2645

@kolyshkin

Description

@kolyshkin

While looking into #2639 I found out we have two --rootless flags with different meaning:

  1. Global flag, documented in runc help as
   --rootless value    ignore cgroup permission errors ('true', 'false', or 'auto') (default: "auto")
  1. A flag specific to spec, documented in runc spec --help as
   --rootless                generate a configuration for a rootless container

The problem here is non-uniform syntax:

  1. The first (global) option applies (I guess) to create, run, exec and update), the second applies to spec.

  2. The second option is true boolean, meaning that specifying --rootless is equivalent to --rootless=true. This is what I would expect. The first option is "bool-or-auto" meaning that specifying --rootless is equivalent to no option, and to actually enable rootless mode one has to use --rootless=true.

Both items are confusing, second is more.

Proposal

I think we can do the following to rectify this:

  1. Deprecate the local --rootless flag for runc spec, adding a warning that the global one should be used.

  2. Make the global --rootless equivalent to --rootless=yes, and warn that using --rootless=auto is deprecated (as it is "auto" without specifying any option).

  3. Eventually remove the local --rootless and the global --rootless=auto.

@AkihiroSuda @cyphar @mrunalp what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions