Skip to content

Commit

Permalink
fix error with unix socket not resolving on dial
Browse files Browse the repository at this point in the history
  • Loading branch information
faide committed Feb 11, 2017
1 parent c342fd4 commit b9705d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package docker

import (
"context"

This comment has been minimized.

Copy link
@envygeeks

envygeeks Mar 26, 2017

This should be golang.org/x/net/context not context Your changes broke this client.

This comment has been minimized.

Copy link
@fsouza

fsouza Apr 3, 2017

Owner

@envygeeks sorry for the delayed response, I was out on vacation. "context" is available on Go 1.7, which is the minimum requirement of go-dockerclient.

Using Go 1.6 is not recommended. As of the Go 1.8 release, Go 1.6 has been officially abandoned by the Go team.

This comment has been minimized.

Copy link
@envygeeks

envygeeks Apr 4, 2017

This is double speak, your client fully supported 1.6 until this change. Your argument only suites to creating inconsistency in your source and to not make it so that it works with 1.6 again for a few more months... instead of doing things suddenly and drastically (this wouldn't be a problem if you had supported gopkg.in -- I would just stay where I was.) 1.6 will be in the Ubuntu LTS repos, as well as the Fedora repos for a few more months until Ubuntu updates the repositories to 1.8... people are dropping it like flies the day 1.8 comes out.

This comment has been minimized.

Copy link
@fsouza

fsouza Apr 4, 2017

Owner

@envygeeks Go 1.6 is no longer supported by the Go team, which means it's not "maintained" anymore and will not receive any updates, including security updates. This is the Go release policy: https://golang.org/doc/devel/release.html#policy

This comment has been minimized.

Copy link
@fsouza

fsouza Apr 4, 2017

Owner

Just to clarify: I'm happy to review a change that make this compatible with Go 1.6 and 1.7+ (using buildtags). Just changing the import path will not fix the issue.

I'm also OK with keeping the code as is, because Go 1.6 is no longer supported by the Go team.

Thank you!

This comment has been minimized.

Copy link
@envygeeks

envygeeks Apr 4, 2017

No worries, even though that is all it takes since that's all we had to do, we'll be moving to the official repositories for Docker as they have a more stable stance on their source in general.

"net"
"net/http"

Expand All @@ -20,7 +21,7 @@ func (c *Client) initializeNativeClient() {
}
socketPath := c.endpointURL.Path
tr := cleanhttp.DefaultTransport()
tr.Dial = func(network, addr string) (net.Conn, error) {
tr.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
return c.Dialer.Dial(unixProtocol, socketPath)
}
c.nativeHTTPClient = &http.Client{Transport: tr}
Expand Down

0 comments on commit b9705d7

Please sign in to comment.