mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Refactor configuration to compose syntax
This commit is contained in:
@@ -3,6 +3,8 @@ package docker
|
||||
import (
|
||||
"time"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
|
||||
dockerClient "github.com/fsouza/go-dockerclient"
|
||||
"github.com/rancherio/os/config"
|
||||
)
|
||||
@@ -26,12 +28,16 @@ func NewClient(endpoint string) (*dockerClient.Client, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
retry := false
|
||||
for i := 0; i < (MAX_WAIT / INTERVAL); i++ {
|
||||
_, err = client.Info()
|
||||
if err == nil {
|
||||
break
|
||||
}
|
||||
|
||||
retry = true
|
||||
|
||||
log.Infof("Waiting for Docker at %s", endpoint)
|
||||
time.Sleep(INTERVAL * time.Millisecond)
|
||||
}
|
||||
|
||||
@@ -39,5 +45,8 @@ func NewClient(endpoint string) (*dockerClient.Client, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if retry {
|
||||
log.Infof("Connected to Docker at %s", endpoint)
|
||||
}
|
||||
return client, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user