Skip to content

Commit f510f9d

Browse files
committed
Use default cert dir for oc cluster up client if DOCKER_TLS_VERIFY is set
1 parent ddc645f commit f510f9d

File tree

1 file changed

+8
-2
lines changed
  • pkg/bootstrap/docker

1 file changed

+8
-2
lines changed

pkg/bootstrap/docker/up.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"runtime"
1010

1111
"github.com/blang/semver"
12+
"github.com/docker/docker/cliconfig"
1213
dockerclient "github.com/docker/engine-api/client"
1314
docker "github.com/fsouza/go-dockerclient"
1415
"github.com/golang/glog"
@@ -423,10 +424,15 @@ func getDockerClient(out io.Writer, dockerMachine string, canStartDockerMachine
423424
return dockerClient, engineAPIClient, nil
424425
}
425426

427+
dockerTLSVerify := os.Getenv("DOCKER_TLS_VERIFY")
428+
dockerCertPath := os.Getenv("DOCKER_CERT_PATH")
429+
if len(dockerTLSVerify) > 0 && len(dockerCertPath) == 0 {
430+
dockerCertPath = cliconfig.ConfigDir()
431+
os.Setenv("DOCKER_CERT_PATH", dockerCertPath)
432+
}
433+
426434
if glog.V(4) {
427435
dockerHost := os.Getenv("DOCKER_HOST")
428-
dockerTLSVerify := os.Getenv("DOCKER_TLS_VERIFY")
429-
dockerCertPath := os.Getenv("DOCKER_CERT_PATH")
430436
if len(dockerHost) == 0 && len(dockerTLSVerify) == 0 && len(dockerCertPath) == 0 {
431437
glog.Infof("No Docker environment variables found. Will attempt default socket.")
432438
}

0 commit comments

Comments
 (0)