1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00

Support nil cfg for NewClient

This commit is contained in:
Darren Shepherd
2015-02-14 09:29:30 -07:00
parent bcf66e4c93
commit dd8265b042

View File

@@ -13,7 +13,11 @@ const (
)
func NewClient(cfg *config.Config) (*dockerClient.Client, error) {
client, err := dockerClient.NewClient(cfg.DockerEndpoint)
endpoint := "unix:///var/run/docker.sock"
if cfg != nil {
endpoint = cfg.DockerEndpoint
}
client, err := dockerClient.NewClient(endpoint)
if err != nil {
return nil, err
}