Skip to content

Commit

Permalink
Merge pull request #9993 from csrwng/clusterup_dm_fix
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jul 25, 2016
2 parents e430003 + 8833701 commit 31be83e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkg/bootstrap/docker/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,18 @@ func (c *ClientStartConfig) determineIP(out io.Writer) (string, error) {
return ip.String(), nil
}

if len(c.DockerMachine) > 0 {
// If a docker machine is specified, port forwarding will not be used
c.PortForwarding = false
glog.V(2).Infof("Using docker machine %q to determine server IP", c.DockerMachine)
ip, err := dockermachine.IP(c.DockerMachine)
if err != nil {
return "", errors.NewError("Could not determine IP address").WithCause(err).WithSolution("Ensure that docker-machine is functional.")
}
fmt.Fprintf(out, "Using docker-machine IP %s as the host IP\n", ip)
return ip, nil
}

// If using port-forwarding, find a local IP that can be used to communicate with the
// Origin container
if c.PortForwarding {
Expand Down Expand Up @@ -763,16 +775,6 @@ func (c *ClientStartConfig) determineIP(out io.Writer) (string, error) {
return "", errors.NewError("could not determine local IP address to use").WithCause(err)
}

if len(c.DockerMachine) > 0 {
glog.V(2).Infof("Using docker machine %q to determine server IP", c.DockerMachine)
ip, err := dockermachine.IP(c.DockerMachine)
if err != nil {
return "", errors.NewError("Could not determine IP address").WithCause(err).WithSolution("Ensure that docker-machine is functional.")
}
fmt.Fprintf(out, "Using docker-machine IP %s as the host IP\n", ip)
return ip, nil
}

// First, try to get the host from the DOCKER_HOST if communicating via tcp
var err error
ip := c.DockerHelper().HostIP()
Expand Down

0 comments on commit 31be83e

Please sign in to comment.