From 5f5685e45df8b16437e1f37deed5b1410ab2f245 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 18 Aug 2026 08:34:39 +0200 Subject: [PATCH] docs(remote): git/OCI remote flags are opt-outs enabled by default COMPOSE_EXPERIMENTAL_GIT_REMOTE and COMPOSE_EXPERIMENTAL_OCI_REMOTE default to true when unset, despite the EXPERIMENTAL name suggesting an opt-in. Document that semantic at the declaration and read sites instead of leaving readers to infer it from the parsing code. Part of #14074 (section D, item 4) Signed-off-by: Nicolas De Loof --- pkg/remote/git.go | 6 ++++++ pkg/remote/oci.go | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/pkg/remote/git.go b/pkg/remote/git.go index 689f08dd9..299cb79ec 100644 --- a/pkg/remote/git.go +++ b/pkg/remote/git.go @@ -38,8 +38,14 @@ import ( "github.com/docker/compose/v5/pkg/api" ) +// GIT_REMOTE_ENABLED is the environment variable controlling support for +// git remote compose resources. Despite the EXPERIMENTAL name (kept for +// backward compatibility), the feature is enabled by default: the variable +// is effectively an opt-out, to be set to a falsy value to disable it. const GIT_REMOTE_ENABLED = "COMPOSE_EXPERIMENTAL_GIT_REMOTE" +// gitRemoteLoaderEnabled reports whether git remote resources are enabled. +// Defaults to true when GIT_REMOTE_ENABLED is unset — see the constant doc. func gitRemoteLoaderEnabled() (bool, error) { if v := os.Getenv(GIT_REMOTE_ENABLED); v != "" { enabled, err := strconv.ParseBool(v) diff --git a/pkg/remote/oci.go b/pkg/remote/oci.go index cbc43eddd..efee65dda 100644 --- a/pkg/remote/oci.go +++ b/pkg/remote/oci.go @@ -40,6 +40,10 @@ import ( ) const ( + // OCI_REMOTE_ENABLED is the environment variable controlling support for + // OCI remote compose resources. Despite the EXPERIMENTAL name (kept for + // backward compatibility), the feature is enabled by default: the variable + // is effectively an opt-out, to be set to a falsy value to disable it. OCI_REMOTE_ENABLED = "COMPOSE_EXPERIMENTAL_OCI_REMOTE" OciPrefix = "oci://" ) @@ -70,6 +74,8 @@ func validatePathInBase(base, unsafePath string) error { return nil } +// ociRemoteLoaderEnabled reports whether OCI remote resources are enabled. +// Defaults to true when OCI_REMOTE_ENABLED is unset — see the constant doc. func ociRemoteLoaderEnabled() (bool, error) { if v := os.Getenv(OCI_REMOTE_ENABLED); v != "" { enabled, err := strconv.ParseBool(v)