()
| 374 | } |
| 375 | |
| 376 | func (cli *DockerCli) initializeFromClient() { |
| 377 | ctx, cancel := context.WithTimeout(cli.baseCtx, cli.getInitTimeout()) |
| 378 | defer cancel() |
| 379 | |
| 380 | ping, err := cli.client.Ping(ctx, client.PingOptions{ |
| 381 | NegotiateAPIVersion: true, |
| 382 | ForceNegotiate: true, |
| 383 | }) |
| 384 | if err != nil { |
| 385 | // Default to true if we fail to connect to daemon |
| 386 | cli.serverInfo = ServerInfo{HasExperimental: true} |
| 387 | return |
| 388 | } |
| 389 | cli.serverInfo = ServerInfo{ |
| 390 | HasExperimental: ping.Experimental, |
| 391 | OSType: ping.OSType, |
| 392 | BuildkitVersion: ping.BuilderVersion, |
| 393 | SwarmStatus: ping.SwarmStatus, |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | // ContextStore returns the ContextStore |
| 398 | func (cli *DockerCli) ContextStore() store.Store { |
no test coverage detected