-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
core: add support to connect to docker-machine #83
Conversation
Signed-off-by: Martin Englund <martin@englund.nu>
dockertest.go
Outdated
if endpoint == "" { | ||
if os.Getenv("DOCKER_URL") != "" { | ||
endpoint = os.Getenv("DOCKER_URL") | ||
} else if os.Getenv("DOCKER_MACHINE_NAME") != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this env var set per spec on the host running docker machine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by "per spec"?
You set the environment on your computer using eval $(docker-machine env default)
when sets the following environment:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.174.132:2376"
export DOCKER_CERT_PATH="/Users/martin/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for clarifying!
dockertest.go
Outdated
if endpoint == "" { | ||
if os.Getenv("DOCKER_URL") != "" { | ||
endpoint = os.Getenv("DOCKER_URL") | ||
} else if os.Getenv("DOCKER_MACHINE_NAME") != "" { | ||
client, err = dc.NewClientFromEnv() | ||
goto error_check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please handle the error here directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, do you want to keep the goto for the return, or do it directly here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do it directly here :)
Signed-off-by: Martin Englund <martin@englund.nu>
I don't think I can write a test case for the new code, without some major refactoring as it can't call |
Ok, thanks! |
Fixes #82
Signed-off-by: Martin Englund martin@englund.nu