fix: docker clients not caching properly

This commit is contained in:
yusing 2025-04-16 15:20:25 +08:00
parent 81a6ef9745
commit d7f8359f27

View file

@ -27,6 +27,7 @@ type (
refCount uint32 refCount uint32
closedOn int64 closedOn int64
key string
addr string addr string
dial func(ctx context.Context) (net.Conn, error) dial func(ctx context.Context) (net.Conn, error)
} }
@ -179,6 +180,7 @@ func NewClient(host string) (*SharedClient, error) {
Client: client, Client: client,
refCount: 1, refCount: 1,
addr: addr, addr: addr,
key: host,
dial: dial, dial: dial,
} }
@ -197,7 +199,7 @@ func NewClient(host string) (*SharedClient, error) {
} }
func (c *SharedClient) Key() string { func (c *SharedClient) Key() string {
return c.DaemonHost() return c.key
} }
func (c *SharedClient) Address() string { func (c *SharedClient) Address() string {