Skip to content

Commit

Permalink
Use named pipe as default for swarmd on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Olli Janatuinen <[email protected]>
  • Loading branch information
olljanat authored Jul 7, 2018
1 parent 502d108 commit 3ece1d6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// +build !windows

package defaults

// ControlAPISocket is the default path where clients can contact the swarmd control API.
var ControlAPISocket = "/var/run/swarmd.sock"

// EngineAddr is Docker default socket file on Linux
var EngineAddr = "unix:///var/run/docker.sock"

// StateDir is the default path to the swarmd state directory
var StateDir = "/var/lib/swarmd"
12 changes: 12 additions & 0 deletions cmd/swarmd/defaults/defaults_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// +build windows

package defaults

// ControlAPISocket is the default path where clients can contact the swarmd control API.
var ControlAPISocket = "//./pipe/swarmd"

// EngineAddr is Docker default named pipe on Windows
var EngineAddr = "npipe:////./pipe/docker_engine"

// StateDir is the default path to the swarmd state directory
var StateDir = `C:\ProgramData\swarmd`
2 changes: 1 addition & 1 deletion cmd/swarmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func init() {
mainCmd.Flags().StringP("log-level", "l", "info", "Log level (options \"debug\", \"info\", \"warn\", \"error\", \"fatal\", \"panic\")")
mainCmd.Flags().StringP("state-dir", "d", defaults.StateDir, "State directory")
mainCmd.Flags().StringP("join-token", "", "", "Specifies the secret token required to join the cluster")
mainCmd.Flags().String("engine-addr", "unix:///var/run/docker.sock", "Address of engine instance of agent.")
mainCmd.Flags().String("engine-addr", defaults.EngineAddr, "Address of engine instance of agent.")
mainCmd.Flags().String("containerd-addr", "", "Address of containerd instance of agent.")
mainCmd.Flags().String("containerd-namespace", "swarmd", "Namespace to use when using containerd agent.")
mainCmd.Flags().String("hostname", "", "Override reported agent hostname")
Expand Down

0 comments on commit 3ece1d6

Please sign in to comment.