mirror of
https://github.com/rancher/os.git
synced 2025-09-05 00:37:12 +00:00
Support nil cfg for NewClient
This commit is contained in:
@@ -13,7 +13,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewClient(cfg *config.Config) (*dockerClient.Client, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user