mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +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) {
|
||||
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
|
||||
}
|
||||
|
Reference in New Issue
Block a user