From 4399a05e841b0dc48a260b7a0dc482aac67ded8c Mon Sep 17 00:00:00 2001 From: Drew Erny Date: Wed, 19 Oct 2016 16:09:54 -0700 Subject: [PATCH] use named pipe on windows Signed-off-by: Drew Erny Upstream-commit: 5b6c565f74731201f7a03163516048f454e9e9d5 Component: engine --- components/engine/daemon/cluster/cluster.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/engine/daemon/cluster/cluster.go b/components/engine/daemon/cluster/cluster.go index f2f5c3aae4..7814b02167 100644 --- a/components/engine/daemon/cluster/cluster.go +++ b/components/engine/daemon/cluster/cluster.go @@ -7,6 +7,7 @@ import ( "net" "os" "path/filepath" + "runtime" "strings" "sync" "time" @@ -277,13 +278,20 @@ func (c *Cluster) startNewNode(conf nodeStartConfig) (*node, error) { } } + var control string + if runtime.GOOS == "windows" { + control = `\\.\pipe\` + controlSocket + } else { + control = filepath.Join(c.runtimeRoot, controlSocket) + } + c.node = nil c.cancelDelay = nil c.stop = false n, err := swarmnode.New(&swarmnode.Config{ Hostname: c.config.Name, ForceNewCluster: conf.forceNewCluster, - ListenControlAPI: filepath.Join(c.runtimeRoot, controlSocket), + ListenControlAPI: control, ListenRemoteAPI: conf.ListenAddr, AdvertiseRemoteAPI: conf.AdvertiseAddr, JoinAddr: conf.joinAddr,