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"
|
"github.com/spf13/cobra"
|
||||||
"k8s.io/minikube/pkg/minikube/cluster"
|
"k8s.io/minikube/pkg/minikube/cluster"
|
||||||
"k8s.io/minikube/pkg/minikube/config"
|
"k8s.io/minikube/pkg/minikube/config"
|
||||||
"k8s.io/minikube/pkg/minikube/constants"
|
|
||||||
"k8s.io/minikube/pkg/minikube/exit"
|
"k8s.io/minikube/pkg/minikube/exit"
|
||||||
"k8s.io/minikube/pkg/minikube/machine"
|
"k8s.io/minikube/pkg/minikube/machine"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
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 "
|
fishSetPfx = "set -gx "
|
||||||
fishSetSfx = "\";\n"
|
fishSetSfx = "\";\n"
|
||||||
|
@ -108,16 +107,15 @@ REM @FOR /f "tokens=*" %i IN ('minikube docker-env') DO @%i
|
||||||
|
|
||||||
// ShellConfig represents the shell config
|
// ShellConfig represents the shell config
|
||||||
type ShellConfig struct {
|
type ShellConfig struct {
|
||||||
Prefix string
|
Prefix string
|
||||||
Delimiter string
|
Delimiter string
|
||||||
Suffix string
|
Suffix string
|
||||||
DockerCertPath string
|
DockerCertPath string
|
||||||
DockerHost string
|
DockerHost string
|
||||||
DockerTLSVerify string
|
DockerTLSVerify string
|
||||||
DockerAPIVersion string
|
UsageHint string
|
||||||
UsageHint string
|
NoProxyVar string
|
||||||
NoProxyVar string
|
NoProxyValue string
|
||||||
NoProxyValue string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -165,11 +163,10 @@ func shellCfgSet(api libmachine.API) (*ShellConfig, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
shellCfg := &ShellConfig{
|
shellCfg := &ShellConfig{
|
||||||
DockerCertPath: envMap["DOCKER_CERT_PATH"],
|
DockerCertPath: envMap["DOCKER_CERT_PATH"],
|
||||||
DockerHost: envMap["DOCKER_HOST"],
|
DockerHost: envMap["DOCKER_HOST"],
|
||||||
DockerTLSVerify: envMap["DOCKER_TLS_VERIFY"],
|
DockerTLSVerify: envMap["DOCKER_TLS_VERIFY"],
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: generateUsageHint(userShell),
|
||||||
UsageHint: generateUsageHint(userShell),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if noProxy {
|
if noProxy {
|
||||||
|
|
|
@ -58,14 +58,13 @@ var defaultAPI = &tests.MockAPI{
|
||||||
// Most of the shell cfg isn't configurable
|
// Most of the shell cfg isn't configurable
|
||||||
func newShellCfg(shell, prefix, suffix, delim string) *ShellConfig {
|
func newShellCfg(shell, prefix, suffix, delim string) *ShellConfig {
|
||||||
return &ShellConfig{
|
return &ShellConfig{
|
||||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||||
DockerTLSVerify: "1",
|
DockerTLSVerify: "1",
|
||||||
DockerHost: "tcp://127.0.0.1:2376",
|
DockerHost: "tcp://127.0.0.1:2376",
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: generateUsageHint(shell),
|
||||||
UsageHint: generateUsageHint(shell),
|
Prefix: prefix,
|
||||||
Prefix: prefix,
|
Suffix: suffix,
|
||||||
Suffix: suffix,
|
Delimiter: delim,
|
||||||
Delimiter: delim,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,16 +140,15 @@ func TestShellCfgSet(t *testing.T) {
|
||||||
noProxyValue: "",
|
noProxyValue: "",
|
||||||
noProxyFlag: true,
|
noProxyFlag: true,
|
||||||
expectedShellCfg: &ShellConfig{
|
expectedShellCfg: &ShellConfig{
|
||||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||||
DockerTLSVerify: "1",
|
DockerTLSVerify: "1",
|
||||||
DockerHost: "tcp://127.0.0.1:2376",
|
DockerHost: "tcp://127.0.0.1:2376",
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: usageHintMap["bash"],
|
||||||
UsageHint: usageHintMap["bash"],
|
Prefix: bashSetPfx,
|
||||||
Prefix: bashSetPfx,
|
Suffix: bashSetSfx,
|
||||||
Suffix: bashSetSfx,
|
Delimiter: bashSetDelim,
|
||||||
Delimiter: bashSetDelim,
|
NoProxyVar: "NO_PROXY",
|
||||||
NoProxyVar: "NO_PROXY",
|
NoProxyValue: "127.0.0.1",
|
||||||
NoProxyValue: "127.0.0.1",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -161,16 +159,15 @@ func TestShellCfgSet(t *testing.T) {
|
||||||
noProxyValue: "",
|
noProxyValue: "",
|
||||||
noProxyFlag: true,
|
noProxyFlag: true,
|
||||||
expectedShellCfg: &ShellConfig{
|
expectedShellCfg: &ShellConfig{
|
||||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||||
DockerTLSVerify: "1",
|
DockerTLSVerify: "1",
|
||||||
DockerHost: "tcp://127.0.0.1:2376",
|
DockerHost: "tcp://127.0.0.1:2376",
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: usageHintMap["bash"],
|
||||||
UsageHint: usageHintMap["bash"],
|
Prefix: bashSetPfx,
|
||||||
Prefix: bashSetPfx,
|
Suffix: bashSetSfx,
|
||||||
Suffix: bashSetSfx,
|
Delimiter: bashSetDelim,
|
||||||
Delimiter: bashSetDelim,
|
NoProxyVar: "no_proxy",
|
||||||
NoProxyVar: "no_proxy",
|
NoProxyValue: "127.0.0.1",
|
||||||
NoProxyValue: "127.0.0.1",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -181,16 +178,15 @@ func TestShellCfgSet(t *testing.T) {
|
||||||
noProxyValue: "127.0.0.1",
|
noProxyValue: "127.0.0.1",
|
||||||
noProxyFlag: true,
|
noProxyFlag: true,
|
||||||
expectedShellCfg: &ShellConfig{
|
expectedShellCfg: &ShellConfig{
|
||||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||||
DockerTLSVerify: "1",
|
DockerTLSVerify: "1",
|
||||||
DockerHost: "tcp://127.0.0.1:2376",
|
DockerHost: "tcp://127.0.0.1:2376",
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: usageHintMap["bash"],
|
||||||
UsageHint: usageHintMap["bash"],
|
Prefix: bashSetPfx,
|
||||||
Prefix: bashSetPfx,
|
Suffix: bashSetSfx,
|
||||||
Suffix: bashSetSfx,
|
Delimiter: bashSetDelim,
|
||||||
Delimiter: bashSetDelim,
|
NoProxyVar: "no_proxy",
|
||||||
NoProxyVar: "no_proxy",
|
NoProxyValue: "127.0.0.1",
|
||||||
NoProxyValue: "127.0.0.1",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -201,16 +197,15 @@ func TestShellCfgSet(t *testing.T) {
|
||||||
noProxyValue: "0.0.0.0",
|
noProxyValue: "0.0.0.0",
|
||||||
noProxyFlag: true,
|
noProxyFlag: true,
|
||||||
expectedShellCfg: &ShellConfig{
|
expectedShellCfg: &ShellConfig{
|
||||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||||
DockerTLSVerify: "1",
|
DockerTLSVerify: "1",
|
||||||
DockerHost: "tcp://127.0.0.1:2376",
|
DockerHost: "tcp://127.0.0.1:2376",
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: usageHintMap["bash"],
|
||||||
UsageHint: usageHintMap["bash"],
|
Prefix: bashSetPfx,
|
||||||
Prefix: bashSetPfx,
|
Suffix: bashSetSfx,
|
||||||
Suffix: bashSetSfx,
|
Delimiter: bashSetDelim,
|
||||||
Delimiter: bashSetDelim,
|
NoProxyVar: "no_proxy",
|
||||||
NoProxyVar: "no_proxy",
|
NoProxyValue: "0.0.0.0,127.0.0.1",
|
||||||
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",
|
noProxyValue: "0.0.0.0,127.0.0.1",
|
||||||
noProxyFlag: true,
|
noProxyFlag: true,
|
||||||
expectedShellCfg: &ShellConfig{
|
expectedShellCfg: &ShellConfig{
|
||||||
DockerCertPath: constants.MakeMiniPath("certs"),
|
DockerCertPath: constants.MakeMiniPath("certs"),
|
||||||
DockerTLSVerify: "1",
|
DockerTLSVerify: "1",
|
||||||
DockerHost: "tcp://127.0.0.1:2376",
|
DockerHost: "tcp://127.0.0.1:2376",
|
||||||
DockerAPIVersion: constants.DockerAPIVersion,
|
UsageHint: usageHintMap["bash"],
|
||||||
UsageHint: usageHintMap["bash"],
|
Prefix: bashSetPfx,
|
||||||
Prefix: bashSetPfx,
|
Suffix: bashSetSfx,
|
||||||
Suffix: bashSetSfx,
|
Delimiter: bashSetDelim,
|
||||||
Delimiter: bashSetDelim,
|
NoProxyVar: "no_proxy",
|
||||||
NoProxyVar: "no_proxy",
|
NoProxyValue: "0.0.0.0,127.0.0.1",
|
||||||
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")
|
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
|
// ReportingURL is the URL for reporting a minikube error
|
||||||
const ReportingURL = "https://clouderrorreporting.googleapis.com/v1beta1/projects/k8s-minikube/events:report?key=AIzaSyACUwzG0dEPcl-eOgpDKnyKoUFgHdfoFuA"
|
const ReportingURL = "https://clouderrorreporting.googleapis.com/v1beta1/projects/k8s-minikube/events:report?key=AIzaSyACUwzG0dEPcl-eOgpDKnyKoUFgHdfoFuA"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue