Skip to content

Commit

Permalink
windows: support -dev mode
Browse files Browse the repository at this point in the history
Support running `nomad agent -dev` in Windows, by setting proper network
interface.

Prior to this change, `nomad` uses `lo` interface but Windows uses
"Loopback Pseudo-Interface 1" to refer to loopback device interface:
https://github.com/golang/go/blob/go1.14.1/src/net/net_windows_test.go#L304-L318
.
  • Loading branch information
Mahmood Ali committed Mar 28, 2020
1 parent a8cf497 commit b398f28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions command/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,11 @@ func newDevModeConfig(devMode, connectMode bool) (*devModeConfig, error) {
}

func (mode *devModeConfig) networkConfig() error {
if runtime.GOOS == "windows" {
mode.bindAddr = "127.0.0.1"
mode.iface = "Loopback Pseudo-Interface 1"
return nil
}
if runtime.GOOS == "darwin" {
mode.bindAddr = "127.0.0.1"
mode.iface = "lo0"
Expand Down

0 comments on commit b398f28

Please sign in to comment.