()
| 526 | } |
| 527 | |
| 528 | func (cli *DockerCli) initialize() error { |
| 529 | cli.init.Do(func() { |
| 530 | cli.dockerEndpoint, cli.initErr = cli.getDockerEndPoint() |
| 531 | if cli.initErr != nil { |
| 532 | cli.initErr = fmt.Errorf("unable to resolve docker endpoint: %w", cli.initErr) |
| 533 | return |
| 534 | } |
| 535 | if cli.client == nil { |
| 536 | if cli.client, cli.initErr = newAPIClientFromEndpoint(cli.dockerEndpoint, cli.configFile, cli.clientOpts...); cli.initErr != nil { |
| 537 | return |
| 538 | } |
| 539 | } |
| 540 | if cli.baseCtx == nil { |
| 541 | cli.baseCtx = context.Background() |
| 542 | } |
| 543 | cli.initializeFromClient() |
| 544 | }) |
| 545 | return cli.initErr |
| 546 | } |
| 547 | |
| 548 | // ServerInfo stores details about the supported features and platform of the |
| 549 | // server |
no test coverage detected