Merge pull request #4364 from tstromberg/no-docker-version
docker-env: Remove DOCKER_API_VERSIONpull/4370/head
commit
db37c03063
|
@ -35,13 +35,12 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
"k8s.io/minikube/pkg/minikube/cluster"
|
||||
"k8s.io/minikube/pkg/minikube/config"
|
||||
"k8s.io/minikube/pkg/minikube/constants"
|
||||
"k8s.io/minikube/pkg/minikube/exit"
|
||||
"k8s.io/minikube/pkg/minikube/machine"
|
||||
)
|
||||
|
||||
const (
|
||||
envTmpl = `{{ .Prefix }}DOCKER_TLS_VERIFY{{ .Delimiter }}{{ .DockerTLSVerify }}{{ .Suffix }}{{ .Prefix }}DOCKER_HOST{{ .Delimiter }}{{ .DockerHost }}{{ .Suffix }}{{ .Prefix }}DOCKER_CERT_PATH{{ .Delimiter }}{{ .DockerCertPath }}{{ .Suffix }}{{ .Prefix }}DOCKER_API_VERSION{{ .Delimiter }}{{ .DockerAPIVersion }}{{ .Suffix }}{{ if .NoProxyVar }}{{ .Prefix }}{{ .NoProxyVar }}{{ .Delimiter }}{{ .NoProxyValue }}{{ .Suffix }}{{end}}{{ .UsageHint }}`
|
||||
envTmpl = `{{ .Prefix }}DOCKER_TLS_VERIFY{{ .Delimiter }}{{ .DockerTLSVerify }}{{ .Suffix }}{{ .Prefix }}DOCKER_HOST{{ .Delimiter }}{{ .DockerHost }}{{ .Suffix }}{{ .Prefix }}DOCKER_CERT_PATH{{ .Delimiter }}{{ .DockerCertPath }}{{ .Suffix }}{{ if .NoProxyVar }}{{ .Prefix }}{{ .NoProxyVar }}{{ .Delimiter }}{{ .NoProxyValue }}{{ .Suffix }}{{end}}{{ .UsageHint }}`
|
||||
|
||||
fishSetPfx = "set -gx "
|
||||
fishSetSfx = "\";\n"
|
||||
|
@ -108,16 +107,15 @@ REM @FOR /f "tokens=*" %i IN ('minikube docker-env') DO @%i
|
|||
|
||||
// ShellConfig represents the shell config
|
||||
type ShellConfig struct {
|
||||
Prefix string
|
||||
Delimiter string
|
||||
Suffix string
|
||||
DockerCertPath string
|
||||
DockerHost string
|
||||
DockerTLSVerify string
|
||||
DockerAPIVersion string
|
||||
UsageHint string
|
||||
NoProxyVar string
|
||||
NoProxyValue string
|
||||
Prefix string
|
||||
Delimiter string
|
||||
Suffix string
|
||||
DockerCertPath string
|
||||
DockerHost string
|
||||
DockerTLSVerify string
|
||||
UsageHint string
|
||||
NoProxyVar string
|
||||
NoProxyValue string
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -165,11 +163,10 @@ func shellCfgSet(api libmachine.API) (*ShellConfig, error) {
|
|||
}
|
||||
|
||||
shellCfg := &ShellConfig{
|
||||
DockerCertPath: envMap["DOCKER_CERT_PATH"],
|
||||
DockerHost: envMap["DOCKER_HOST"],
|
||||
DockerTLSVerify: envMap["DOCKER_TLS_VERIFY"],
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: generateUsageHint(userShell),
|
||||
DockerCertPath: envMap["DOCKER_CERT_PATH"],
|
||||
DockerHost: envMap["DOCKER_HOST"],
|
||||
DockerTLSVerify: envMap["DOCKER_TLS_VERIFY"],
|
||||
UsageHint: generateUsageHint(userShell),
|
||||
}
|
||||
|
||||
if noProxy {
|
||||
|
|
|
@ -58,14 +58,13 @@ var defaultAPI = &tests.MockAPI{
|
|||
// Most of the shell cfg isn't configurable
|
||||
func newShellCfg(shell, prefix, suffix, delim string) *ShellConfig {
|
||||
return &ShellConfig{
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: generateUsageHint(shell),
|
||||
Prefix: prefix,
|
||||
Suffix: suffix,
|
||||
Delimiter: delim,
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
UsageHint: generateUsageHint(shell),
|
||||
Prefix: prefix,
|
||||
Suffix: suffix,
|
||||
Delimiter: delim,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,16 +140,15 @@ func TestShellCfgSet(t *testing.T) {
|
|||
noProxyValue: "",
|
||||
noProxyFlag: true,
|
||||
expectedShellCfg: &ShellConfig{
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "NO_PROXY",
|
||||
NoProxyValue: "127.0.0.1",
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "NO_PROXY",
|
||||
NoProxyValue: "127.0.0.1",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -161,16 +159,15 @@ func TestShellCfgSet(t *testing.T) {
|
|||
noProxyValue: "",
|
||||
noProxyFlag: true,
|
||||
expectedShellCfg: &ShellConfig{
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "127.0.0.1",
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "127.0.0.1",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -181,16 +178,15 @@ func TestShellCfgSet(t *testing.T) {
|
|||
noProxyValue: "127.0.0.1",
|
||||
noProxyFlag: true,
|
||||
expectedShellCfg: &ShellConfig{
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "127.0.0.1",
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "127.0.0.1",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -201,16 +197,15 @@ func TestShellCfgSet(t *testing.T) {
|
|||
noProxyValue: "0.0.0.0",
|
||||
noProxyFlag: true,
|
||||
expectedShellCfg: &ShellConfig{
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "0.0.0.0,127.0.0.1",
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "0.0.0.0,127.0.0.1",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -221,16 +216,15 @@ func TestShellCfgSet(t *testing.T) {
|
|||
noProxyValue: "0.0.0.0,127.0.0.1",
|
||||
noProxyFlag: true,
|
||||
expectedShellCfg: &ShellConfig{
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
DockerAPIVersion: constants.DockerAPIVersion,
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "0.0.0.0,127.0.0.1",
|
||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||
DockerTLSVerify: "1",
|
||||
DockerHost: "tcp://127.0.0.1:2376",
|
||||
UsageHint: usageHintMap["bash"],
|
||||
Prefix: bashSetPfx,
|
||||
Suffix: bashSetSfx,
|
||||
Delimiter: bashSetDelim,
|
||||
NoProxyVar: "no_proxy",
|
||||
NoProxyValue: "0.0.0.0,127.0.0.1",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -181,9 +181,6 @@ func GetProfileFile(profile string) string {
|
|||
return filepath.Join(GetMinipath(), "profiles", profile, "config.json")
|
||||
}
|
||||
|
||||
// DockerAPIVersion is the API version implemented by Docker running in the minikube VM.
|
||||
const DockerAPIVersion = "1.39"
|
||||
|
||||
// ReportingURL is the URL for reporting a minikube error
|
||||
const ReportingURL = "https://clouderrorreporting.googleapis.com/v1beta1/projects/k8s-minikube/events:report?key=AIzaSyACUwzG0dEPcl-eOgpDKnyKoUFgHdfoFuA"
|
||||
|
||||
|
|
Loading…
Reference in New Issue