Repository navigation
Description
User Story
I configure compute drivers through the gateway's driver tables and through environment variables, and I rely on an explicit setting in the table to hold. I directly encountered, while reviewing the launched-driver contract, that boolean-like settings follow different precedence rules depending on the driver and the type of the setting. This affects whether an inherited environment variable can override an explicit opt-out in the operator's own configuration.
Problem Statement
Several settings can be given in a driver table and as an environment variable, and they do not follow one rule:
- Environment
false. For the VM driver onmain, an environmentfalseon a flag that acknowledges another setting (OPENSHELL_VM_UPSTREAM_PROXY_AUTH_ALLOW_INSECURE,…_CONNECT_BY_HOSTNAME) meant unset. The Kubernetes driver'sArgAction::SetTrueflags behave the same way. The Podman driver's standaloneOPENSHELL_SANDBOX_PROXY_AUTH_ALLOW_INSECUREis a plainOption<bool>, so an environmentfalseisSome(false), and the shared validation can reject it. - Explicit table value versus the environment. For
Optionsettings an explicit table value wins over the environment. For the VM driver's plainboolandVecsettings (enable_bind_mounts,provider_spiffe_allow_guest_tcp,nat64_prefixes), a table value offalseor[]cannot be told from an omitted key, so an inherited environment variable can enable them against an explicit opt-out. The VM driver kept this precedence frommain, where the gateway passed a flag only when the value was on. - Spelling. Clap accepts only lowercase
trueandfalsefrom the environment for these flags. Empty values are an error in clap and are ignored in the VM driver's settings.
Impact / Why This Matters
enable_bind_mounts exposes host paths to sandboxes. An environment variable that overrides an explicit enable_bind_mounts = false in the operator's configuration is surprising. The mixed rules across drivers also make it hard to document how environment variables and tables combine.
Desired Workflow
Boolean-like settings that exist as both a table key and an environment variable follow one documented rule, and the same rule applies to every driver that has them. The rule itself is not decided yet. The questions to settle:
- What an environment
falsemeans: unset, or an explicitfalsethat can fail validation. The VM and Kubernetes drivers treat it as unset today, and the Podman standalone binary does not. - Whether an explicit table value, including
falseand[], takes precedence over the environment, or whether the environment can still override it as it can for the VM driver's plainboolandVecsettings today. - Whether the environment can only enable a setting, or can also disable one.
- How an empty environment value and non-
true/falsespellings are handled, and whether every driver reports them the same way. - Whether these settings keep their per-driver environment variables or move to one shared configuration, as in feat: configure the upstream proxy once for all compute drivers #5933.
Acceptance Criteria
- The rule is decided, with the reasons for it, and stated in one place in the gateway configuration documentation.
- Every setting of this kind follows it, in every driver that has them, with tests for the combinations of a table value (absent,
true,false, empty) and an environment value (unset,true,false, invalid). - If the rule changes the behaviour of an existing configuration, the release notes say so.
Related: #5933 (one upstream proxy configuration for all drivers), #5384, #5385. Deferred from the launcher PR (#5914).
Activity