mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Merge pull request #6282 from hashicorp/f-connect-dev-path
connect: check if consul is on PATH
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -705,6 +706,10 @@ func newDevModeConfig(devMode, connectMode bool) (*devModeConfig, error) {
|
||||
return nil, fmt.Errorf(
|
||||
"-dev-connect uses network namespaces and is only supported for root.")
|
||||
}
|
||||
// Ensure Consul is on PATH
|
||||
if _, err := exec.LookPath("consul"); err != nil {
|
||||
return nil, fmt.Errorf("-dev-connect requires a 'consul' binary in Nomad's $PATH")
|
||||
}
|
||||
mode.connectMode = true
|
||||
}
|
||||
err := mode.networkConfig()
|
||||
|
||||
Reference in New Issue
Block a user