Skip to content

Commit d783c49

Browse files
authored
Merge pull request #454 from docker/client/default-socket
feat: move to standalone daemon socket path
2 parents 1b233c7 + 3311bd4 commit d783c49

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func New(options ...Option) (Client, error) {
9898
}
9999
}
100100
if cfg.dialContext == nil {
101-
cfg.dialContext = dialFromPath(api.DefaultSocketPath())
101+
cfg.dialContext = dialFromPath(api.DaemonSocketPath())
102102
}
103103
c := &http.Client{
104104
Transport: &http.Transport{

plugin/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func newCfgForManualLaunch(p ExternalPlugin, opts ...ManualLaunchOption) (*cfg,
8181
}
8282
}
8383
if cfg.conn == nil {
84-
defaultSocketPath := api.DefaultSocketPath()
85-
conn, err := net.Dial("unix", defaultSocketPath)
84+
socketPath := api.DaemonSocketPath()
85+
conn, err := net.Dial("unix", socketPath)
8686
if err != nil {
87-
return nil, fmt.Errorf("failed to connect to default socket %q: %w", defaultSocketPath, err)
87+
return nil, fmt.Errorf("failed to connect to default socket %q: %w", socketPath, err)
8888
}
8989
hijackedConn, err := ipc.Hijackify(conn, hijackTimeout)
9090
if err != nil {

plugin/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func Test_newCfgForManualLaunch(t *testing.T) {
4343
})
4444
os.Args = []string{"test-plugin"}
4545
t.Setenv("XDG_RUNTIME_DIR", os.TempDir())
46-
socketPath := api.DefaultSocketPath()
46+
socketPath := api.DaemonSocketPath()
4747
os.Remove(socketPath)
4848
require.NoError(t, os.MkdirAll(filepath.Dir(socketPath), 0o755))
4949
listener, err := net.Listen("unix", socketPath)

0 commit comments

Comments
 (0)