mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user