Skip to content

feat: load containers config stack (auth.json, certs.d, registries.conf) behind an experimental env var #2273

Closed

Description

@TerryHowe

Summary

After the oras-go v3 migration (#2002) lands, adopt the v3 containers config stack (config.LoadConfigs()), gated behind an experimental environment variable so the default behavior stays identical to oras-go v2:

export ORAS_EXPERIMENTAL_CONTAINERS_CONFIG=1

When unset (the default), oras keeps the current behavior: Docker config.json credentials only, no registries.conf, no certs.d, no policy.json.

When set, oras loads the containers config files supported by oras-go v3:

  • Podman/containers auth.json credentials
  • certs.d TLS configuration (Custom CA store #2118)
  • registries.conf (mirrors, registry aliases)
  • policy.json (later phase; enforcement needs its own UX design)

Background

#2002 is a mechanical migration and deliberately preserves v2 behavior where v3 defaults differ (for example IgnoreDefaultNativeStore: true in internal/credential/store.go, and the distribution-spec token flow via auth.NewCompositeTokenFetcher). It does not call config.LoadConfigs(). This issue tracks that follow-up, which was previously proposed in #2268.

oras has no runtime feature-flag mechanism today; it only labels flags as [Experimental] / [Preview] in help text. The only existing env var is ORAS_CACHE.

Proposal

The switch only needs to be checked in two places:

  1. internal/credential.NewStore: if the env var is set, build the credential store from config.LoadConfigs() (including auth.json); otherwise keep the existing Docker config store.
  2. option.Remote client/repository construction: if the env var is set, apply certs.d TLS and registries.conf mirror/alias resolution (and later policy.json); otherwise unchanged.

Why an environment variable rather than a flag

  • Process-wide: login, logout, and every remote command go through NewStore / option.Remote; one env check covers all of them.
  • No flag duplication: a flag on option.Remote would be prefixed into --from-… / --to-… on oras cp, which is meaningless for a global setting.
  • Easy to graduate: when stable, flip the default and keep the variable (e.g. =0) as an opt-out without breaking scripts.
  • Precedent: ORAS_CACHE already configures oras via the environment.

An [Experimental] persistent root flag could be added later for discoverability if maintainers prefer.

Open questions

  • Credential precedence: when both ~/.docker/config.json and auth.json have an entry for the same registry, which wins? This is the main user-visible difference and should be decided and documented up front.
  • How does --registry-config interact with the gate (override the whole stack, or only the credential file)?
  • Should oras login write to auth.json or keep writing to the Docker config when the gate is on?
  • Exact variable name (ORAS_EXPERIMENTAL_CONTAINERS_CONFIG is a placeholder).

Suggested implementation order

  1. Env var plumbing + credential store via config.LoadConfigs() (read-only auth.json support)
  2. certs.d TLS (Custom CA store #2118)
  3. registries.conf mirrors/aliases
  4. policy.json (separate design)

Each step with unit tests and E2E coverage both with and without the variable set.

Depends on #2002.

Activity

  1. self-assigned this
    on Oct 23, 2026
  2. added
    enhancement
    experimental
    v3
    on Oct 23, 2026
  3. added this to the future milestone on Oct 23, 2026
  4. TerryHowe commented on Nov 2, 2026

    @TerryHowe
    MemberAuthor

    Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementexperimentalv3

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions