1
0
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:
Darren Shepherd
2015-03-29 02:57:15 -07:00
parent 38389b1f8e
commit c7ae14cc13
11 changed files with 535 additions and 344 deletions

View File

@@ -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
}