Skip to content

Commit

Permalink
Simplify Dockerm machine ip handling
Browse files Browse the repository at this point in the history
Based on review comments from @iwilltry42
  • Loading branch information
andyz-dev committed Jun 5, 2019
1 parent fc6a01d commit fa18c37
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ func CreateCluster(c *cli.Context) error {

// When the 'host' is not provided by --api-port, try to fill it using Docker Machine's IP address.
if apiPort.Host == "" {
if apiPort.Host, err = getDockerMachineIp(); apiPort.Host != "" || err != nil {
if err != nil {
return err
}
if apiPort.Host, err = getDockerMachineIp(); err != nil {
return err
}

// IP address is the same as the host
apiPort.HostIp = apiPort.Host
}

if apiPort.Host != "" {
Expand Down

0 comments on commit fa18c37

Please sign in to comment.