mirror of https://github.com/docker/cli.git
cli/flags: add EnvEnableTLS const for "DOCKER_TLS"
Add a const to allow documenting the environment variable in code. The location of this const is a bit "unfortunate", due to CLI and Client-config to be spread over the cli/config, cli/config/configfile, and docker/docker/client packages (some options are for the client, others for the CLI), and some reorganizing may be useful for easier consumption. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
a26e6011f0
commit
1c1329fc7e
|
@ -14,6 +14,18 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// EnvEnableTLS is the name of the environment variable that can be used
|
||||||
|
// to enable TLS for client connections. When set to a non-empty value, TLS
|
||||||
|
// is enabled for API connections using TCP. For backward-compatibility, this
|
||||||
|
// environment-variable can only be used to enable TLS, not to disable.
|
||||||
|
//
|
||||||
|
// Note that TLS is always enabled implicitly if the "--tls-verify" option
|
||||||
|
// or "DOCKER_TLS_VERIFY" ([github.com/docker/docker/client.EnvTLSVerify])
|
||||||
|
// env var is set to, which could be to either enable or disable TLS certification
|
||||||
|
// validation. In both cases, TLS is enabled but, depending on the setting,
|
||||||
|
// with verification disabled.
|
||||||
|
EnvEnableTLS = "DOCKER_TLS"
|
||||||
|
|
||||||
// DefaultCaFile is the default filename for the CA pem file
|
// DefaultCaFile is the default filename for the CA pem file
|
||||||
DefaultCaFile = "ca.pem"
|
DefaultCaFile = "ca.pem"
|
||||||
// DefaultKeyFile is the default filename for the key pem file
|
// DefaultKeyFile is the default filename for the key pem file
|
||||||
|
@ -39,8 +51,7 @@ Refer to https://docs.docker.com/go/formatting/ for more information about forma
|
||||||
var (
|
var (
|
||||||
dockerCertPath = os.Getenv(client.EnvOverrideCertPath)
|
dockerCertPath = os.Getenv(client.EnvOverrideCertPath)
|
||||||
dockerTLSVerify = os.Getenv(client.EnvTLSVerify) != ""
|
dockerTLSVerify = os.Getenv(client.EnvTLSVerify) != ""
|
||||||
// TODO(thaJeztah) the 'DOCKER_TLS' environment variable is not documented, and does not have a const.
|
dockerTLS = os.Getenv(EnvEnableTLS) != ""
|
||||||
dockerTLS = os.Getenv("DOCKER_TLS") != ""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ClientOptions are the options used to configure the client cli.
|
// ClientOptions are the options used to configure the client cli.
|
||||||
|
|
Loading…
Reference in New Issue