While looking into #2639 I found out we have two --rootless flags with different meaning:
- Global flag, documented in
runc help as
--rootless value ignore cgroup permission errors ('true', 'false', or 'auto') (default: "auto")
- 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:
-
The first (global) option applies (I guess) to create, run, exec and update), the second applies to spec.
-
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:
-
Deprecate the local --rootless flag for runc spec, adding a warning that the global one should be used.
-
Make the global --rootless equivalent to --rootless=yes, and warn that using --rootless=auto is deprecated (as it is "auto" without specifying any option).
-
Eventually remove the local --rootless and the global --rootless=auto.
@AkihiroSuda @cyphar @mrunalp what do you think?
While looking into #2639 I found out we have two
--rootlessflags with different meaning:runc helpasspec, documented inrunc spec --helpasThe problem here is non-uniform syntax:
The first (global) option applies (I guess) to
create,run,execandupdate), the second applies tospec.The second option is true boolean, meaning that specifying
--rootlessis equivalent to--rootless=true. This is what I would expect. The first option is "bool-or-auto" meaning that specifying--rootlessis 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:
Deprecate the local
--rootlessflag forrunc spec, adding a warning that the global one should be used.Make the global
--rootlessequivalent to--rootless=yes, and warn that using--rootless=autois deprecated (as it is "auto" without specifying any option).Eventually remove the local
--rootlessand the global--rootless=auto.@AkihiroSuda @cyphar @mrunalp what do you think?