fix(docker): correct 89cbcfee8c

This commit is contained in:
yusing
2026-01-18 00:53:51 +08:00
parent 4f8bb40d3d
commit 2022a0db82

View File

@@ -149,8 +149,6 @@ func NewClient(cfg types.DockerProviderConfig, unique ...bool) (*SharedClient, e
var addr string
var dial func(ctx context.Context) (net.Conn, error)
opt = append(opt, client.WithAPIVersionNegotiation())
if agent.IsDockerHostAgent(host) {
a, ok := agentpool.Get(host)
if !ok {
@@ -200,6 +198,8 @@ func NewClient(cfg types.DockerProviderConfig, unique ...bool) (*SharedClient, e
opt = append(opt, client.WithTLSClientConfig(cfg.TLS.CAFile, cfg.TLS.CertFile, cfg.TLS.KeyFile))
}
opt = append(opt, client.WithAPIVersionNegotiation())
client, err := client.NewClientWithOpts(opt...)
if err != nil {
return nil, err