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 <[email protected]>
This commit is contained in:
Nicolas De Loof
2026-08-18 11:17:59 +02:00
parent 4781c7ee56
commit 5f5685e45d
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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)
+6
View File
@@ -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)