Forbid the addition of new boolean flags. - #14483
Merged
Merged
Conversation
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
Bot
force-pushed
the
test/cl972841722
branch
2 times, most recently
from
August 28, 2026 23:59
86a99bf to
8a8892f
Compare
PiperOrigin-RevId: 972887723
copybara-service
Bot
force-pushed
the
test/cl972841722
branch
from
August 29, 2026 01:14
8a8892f to
868f239
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forbid the addition of new boolean flags.
Boolean flags have been problematic for two reasons:
--ignore-cgroupswould certainly benefit from having finer granularity, and now we have--systemd-cgroup--nvproxyand--nvproxy-dockerexist independently despite one needing the other)--log-packetscould have been a filter, same as--strace--disable-seccompneeds to be written in negated form just for default-value sanity reasons.--profileneeds to be turned on if any of the other profiling flags are turned on, can't distinguish between thefalse-explicit andfalse-by-default cases.--cpu-num-from-quotawould benefit from an auto default.--oci-seccompstill defaults to false and we can't remove it even though it is a somewhat unsafe default.--enable-core-tags.--overlay2:)FUTURE_COPYBARA_INTEGRATE_REVIEW=#14197 from EtiennePerot:no-bool-flags 73a7a0c