Skip to content

feat(drivers): one precedence rule for boolean-like table and environment settings #6002

Backlog

Description

@elezar

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 on main, an environment false on a flag that acknowledges another setting (OPENSHELL_VM_UPSTREAM_PROXY_AUTH_ALLOW_INSECURE, …_CONNECT_BY_HOSTNAME) meant unset. The Kubernetes driver's ArgAction::SetTrue flags behave the same way. The Podman driver's standalone OPENSHELL_SANDBOX_PROXY_AUTH_ALLOW_INSECURE is a plain Option<bool>, so an environment false is Some(false), and the shared validation can reject it.
  • Explicit table value versus the environment. For Option settings an explicit table value wins over the environment. For the VM driver's plain bool and Vec settings (enable_bind_mounts, provider_spiffe_allow_guest_tcp, nat64_prefixes), a table value of false or [] 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 from main, where the gateway passed a flag only when the value was on.
  • Spelling. Clap accepts only lowercase true and false from 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 false means: unset, or an explicit false that 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 false and [], takes precedence over the environment, or whether the environment can still override it as it can for the VM driver's plain bool and Vec settings today.
  • Whether the environment can only enable a setting, or can also disable one.
  • How an empty environment value and non-true/false spellings 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

  1. added
    area:drivers
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:drivers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions