mirror of https://github.com/docker/docs.git
allow retries for getIp when issuing cert
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
parent
18b58b4601
commit
93dd4f11f6
23
host.go
23
host.go
|
@ -206,9 +206,26 @@ func (h *Host) ConfigureAuth() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
ip, err := h.Driver.GetIP()
|
var (
|
||||||
if err != nil {
|
ip = ""
|
||||||
return err
|
ipErr error
|
||||||
|
maxRetries = 4
|
||||||
|
)
|
||||||
|
|
||||||
|
for i := 0; i < maxRetries; i++ {
|
||||||
|
ip, ipErr = h.Driver.GetIP()
|
||||||
|
if ip != "" {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ipErr != nil {
|
||||||
|
return ipErr
|
||||||
|
}
|
||||||
|
|
||||||
|
if ip == "" {
|
||||||
|
return fmt.Errorf("unable to get machine IP")
|
||||||
}
|
}
|
||||||
|
|
||||||
serverCertPath := filepath.Join(h.storePath, "server.pem")
|
serverCertPath := filepath.Join(h.storePath, "server.pem")
|
||||||
|
|
Loading…
Reference in New Issue