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)