1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 14:23:11 +00:00

Refactor to use libcompose

This commit is contained in:
Darren Shepherd
2015-08-04 14:45:38 -07:00
parent 19f9a1b281
commit 9d76b79ac3
26 changed files with 665 additions and 1458 deletions

View File

@@ -1,10 +1,6 @@
package docker
import (
"time"
log "github.com/Sirupsen/logrus"
dockerClient "github.com/fsouza/go-dockerclient"
"github.com/rancherio/os/config"
)
@@ -28,25 +24,10 @@ 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
}
err = ClientOK(endpoint, func() bool {
_, err := client.Info()
return err == nil
})
retry = true
log.Infof("Waiting for Docker at %s", endpoint)
time.Sleep(INTERVAL * time.Millisecond)
}
if err != nil {
return nil, err
}
if retry {
log.Infof("Connected to Docker at %s", endpoint)
}
return client, nil
return client, err
}