Skip to content

Use default cert dir for oc cluster up engine API client if DOCKER_TLS_VERIFY is set #12035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/bootstrap/docker/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"runtime"

"github.com/blang/semver"
"github.com/docker/docker/cliconfig"
dockerclient "github.com/docker/engine-api/client"
docker "github.com/fsouza/go-dockerclient"
"github.com/golang/glog"
Expand Down Expand Up @@ -423,10 +424,15 @@ func getDockerClient(out io.Writer, dockerMachine string, canStartDockerMachine
return dockerClient, engineAPIClient, nil
}

dockerTLSVerify := os.Getenv("DOCKER_TLS_VERIFY")
dockerCertPath := os.Getenv("DOCKER_CERT_PATH")
if len(dockerTLSVerify) > 0 && len(dockerCertPath) == 0 {
dockerCertPath = cliconfig.ConfigDir()
os.Setenv("DOCKER_CERT_PATH", dockerCertPath)
}

if glog.V(4) {
dockerHost := os.Getenv("DOCKER_HOST")
dockerTLSVerify := os.Getenv("DOCKER_TLS_VERIFY")
dockerCertPath := os.Getenv("DOCKER_CERT_PATH")
if len(dockerHost) == 0 && len(dockerTLSVerify) == 0 && len(dockerCertPath) == 0 {
glog.Infof("No Docker environment variables found. Will attempt default socket.")
}
Expand Down