Merge pull request #6282 from hashicorp/f-connect-dev-path
connect: check if consul is on PATH
This commit is contained in:
commit
31eb8375e5
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue