1
0
mirror of https://github.com/rancher/os.git synced 2025-06-23 05:27:03 +00:00
os/docker/client.go
Wang Long bd81c9dea8 Delete the unused const variable in docker/client.go
The commit 9d76b79ac3 refactor code for function
"NewClient", and we should delete the unused const
variable.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
2015-10-29 22:54:49 +08:00

29 lines
575 B
Go

package docker
import (
dockerClient "github.com/fsouza/go-dockerclient"
"github.com/rancher/os/config"
)
func NewSystemClient() (*dockerClient.Client, error) {
return NewClient(config.DOCKER_SYSTEM_HOST)
}
func NewDefaultClient() (*dockerClient.Client, error) {
return NewClient(config.DOCKER_HOST)
}
func NewClient(endpoint string) (*dockerClient.Client, error) {
client, err := dockerClient.NewClient(endpoint)
if err != nil {
return nil, err
}
err = ClientOK(endpoint, func() bool {
_, err := client.Info()
return err == nil
})
return client, err
}