refactor: pass procfs location to docker_tls_args on command line

...rather than via an env var. This is cleaner.
This commit is contained in:
Matthias Radestock committed 2016-01-01 23:52:46 +00:00
1 parent 9c31de9cb9
commit be8260ae79
2 files changed
+5 -6

No files matched your search

+4 -5
View File
@@ -1,6 +1,5 @@
// docker_tls_args: find the docker daemon's tls args // docker_tls_args: find the docker daemon's tls args
// This reimplements pgrep, because pgrep will only look in /proc, but not in // This reimplements pgrep, because pgrep will only look in /proc.
// $PROCFS.
package main package main
import ( import (
@@ -14,9 +13,9 @@ import (
) )
func main() { func main() {
procRoot := os.Getenv("PROCFS") procRoot := "/proc"
if procRoot == "" { if len(os.Args) > 1 {
procRoot = "/proc" procRoot = os.Args[1]
} }
dirEntries, err := ioutil.ReadDir(procRoot) dirEntries, err := ioutil.ReadDir(procRoot)
+1 -1
View File
@@ -1435,7 +1435,7 @@ proxy_args() {
proxy_parse_args "$@" proxy_parse_args "$@"
if [ -z "$PROXY_TLS_ENABLED" -a -z "$PROXY_TLS_DETECTION_DISABLED" ] && command_exists docker_tls_args ; then if [ -z "$PROXY_TLS_ENABLED" -a -z "$PROXY_TLS_DETECTION_DISABLED" ] && command_exists docker_tls_args ; then
if ! DOCKER_TLS_ARGS=$(docker_tls_args) ; then if ! DOCKER_TLS_ARGS=$(docker_tls_args ${PROCFS:-/proc}) ; then
echo "Unable to auto-detect proxy TLS configuration; you must launch the proxy with" >&2 echo "Unable to auto-detect proxy TLS configuration; you must launch the proxy with" >&2
echo "'weave launch-proxy' and supply '--no-detect-tls' or TLS options." >&2 echo "'weave launch-proxy' and supply '--no-detect-tls' or TLS options." >&2
exit 1 exit 1