Skip to content

Forbid the addition of new boolean flags. - #14483

Merged
copybara-service[bot] merged 2 commits into
masterfrom
test/cl972841722
Aug 29, 2026
Merged

Forbid the addition of new boolean flags.#14483
copybara-service[bot] merged 2 commits into
masterfrom
test/cl972841722

Conversation

@copybara-service

Copy link
Copy Markdown

Forbid the addition of new boolean flags.

Boolean flags have been problematic for two reasons:

  • Can't add more values to them if we need to. Examples:
    • --ignore-cgroups would certainly benefit from having finer granularity, and now we have --systemd-cgroup
    • --nvproxy and --nvproxy-docker exist independently despite one needing the other)
    • --log-packets could have been a filter, same as --strace
    • --disable-seccomp needs to be written in negated form just for default-value sanity reasons.
  • Can't distinguish between a user just wanting the default value vs explicitly wanting a specific setting, which prevents the addition of a "choose automatically" option down the line. Examples:
    • --profile needs to be turned on if any of the other profiling flags are turned on, can't distinguish between the false-explicit and false-by-default cases.
    • --cpu-num-from-quota would benefit from an auto default.
    • --oci-seccomp still defaults to false and we can't remove it even though it is a somewhat unsafe default.
    • Same with --enable-core-tags.
  • And of course: Boolean flags get us flags like --overlay2 :)

FUTURE_COPYBARA_INTEGRATE_REVIEW=#14197 from EtiennePerot:no-bool-flags 73a7a0c

Boolean flags have been problematic for two reasons:

- Can't add more values to them if we need to. Examples:
  - `--ignore-cgroups` would certainly benefit from having finer
    granularity, and now we have `--systemd-cgroup`
  - `--nvproxy` and `--nvproxy-docker` exist independently despite one
    needing the other)
  - `--log-packets` could have been a filter, same as `--strace`
  - `--disable-seccomp` needs to be written in negated form just for
    default-value sanity reasons.
- Can't distinguish between a user just wanting the default value vs
  explicitly wanting a specific setting, which prevents the addition
  of a "choose automatically" option down the line. Examples:
  - `--profile` needs to be turned on if any of the *other* profiling
    flags are turned on, can't distinguish between the `false`-explicit
    and `false`-by-default cases.
  - `--cpu-num-from-quota` would benefit from an auto default.
  - `--oci-seccomp` still defaults to false and we can't remove it even
    though it is a somewhat unsafe default.
  - Same with `--enable-core-tags`.
- And of course: Boolean flags get us flags like `--overlay2` :)
@copybara-service copybara-service Bot added the exported Issue was exported automatically label Aug 28, 2026
@copybara-service
copybara-service Bot force-pushed the test/cl972841722 branch 2 times, most recently from 86a99bf to 8a8892f Compare August 28, 2026 23:59
@copybara-service
copybara-service Bot merged commit 868f239 into master Aug 29, 2026
5 of 8 checks passed
@copybara-service
copybara-service Bot deleted the test/cl972841722 branch August 29, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants