(ep docker.Endpoint, configFile *configfile.ConfigFile, extraOpts ...client.Opt)
| 301 | } |
| 302 | |
| 303 | func newAPIClientFromEndpoint(ep docker.Endpoint, configFile *configfile.ConfigFile, extraOpts ...client.Opt) (client.APIClient, error) { |
| 304 | opts, err := ep.ClientOpts() |
| 305 | if err != nil { |
| 306 | return nil, err |
| 307 | } |
| 308 | if len(configFile.HTTPHeaders) > 0 { |
| 309 | opts = append(opts, client.WithHTTPHeaders(configFile.HTTPHeaders)) |
| 310 | } |
| 311 | withCustomHeaders, err := withCustomHeadersFromEnv() |
| 312 | if err != nil { |
| 313 | return nil, err |
| 314 | } |
| 315 | if withCustomHeaders != nil { |
| 316 | opts = append(opts, withCustomHeaders) |
| 317 | } |
| 318 | opts = append(opts, extraOpts...) |
| 319 | return client.New(opts...) |
| 320 | } |
| 321 | |
| 322 | func resolveDockerEndpoint(s store.Reader, contextName string) (docker.Endpoint, error) { |
| 323 | if s == nil { |
no test coverage detected
searching dependent graphs…